I have a sub-domain for my mobile app which is like http://m.traffic.domain.com now I want that my users can access their page by visiting http://m.traffic.domain.com/username which will internally point to http://m.traffic.domain.com/index.php?username=$1 for this I have following .htaccess rewrite code but its not working as expected rather its redirecting all pages to http://m.traffic.domain.com/index.php?username=$1 this page
# Use PHP5 Single php.ini as default AddHandler application/x-httpd-php5s .php AddHandler application/x-httpd-php .aspx RewriteEngine On RewriteCond %{HTTP_HOST} ^m\.traffic\.domain\.com$ [NC] RewriteCond %1 !^www$ [NC] RewriteRule ^(.+)$ mobile/index.php?username=%1 [L] <Files 403.shtml> order allow,deny allow from all </Files>
The subdomain http://m.traffic.domain.com points to a directory called mobile which can be accessed http://traffic.domain.com/mobile