Monday, 9 September 2013

Htaccess Virtual Subdomain not work properly

Htaccess Virtual Subdomain not work properly

I Use Htaccess File to RewriteRule My Website Subdomains to relative files
on my site. For example:
http://articles.mysite.com --> http://mysite.com/articles I write this code :
RewriteCond %{HTTP_HOST} !^www.mysite.*
RewriteCond %{HTTP_HOST} ^([^.]+).mysite.*
RewriteRule ^$ ./%1 [L]
But When i Want Use This :
http://articles.mysite.com/some/some --> http://mysite.com/articles/some/some
Above code doesn't work properly and redirect me to 404 NotFound Page
Note: In another place of my .htaccess file i have RewriteRule ^some/(.*)$
./some.php?id=$1 [L]

No comments:

Post a Comment