Subdomain to page.php?
how would my .htaccess need to开发者_如何学编程 look if I wanted subdomains to forward to a specific page "parameter"
eg; http://subdomain.c.example.com > http://c.example.com/page.php?i=subdomain
I can't figure out how the .htaccess works.
Try this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)\.c\.example\.com$ [NC]
RewriteRule . http://c.example.com/page.php?i=%1 [L,R]
Also, in the future when doing examples, use example.com
. That domain is provided in the spec for use in documentation, and is guaranteed not to resolve to someone's real domain.
精彩评论