Forum Moderators: phranque
i have a rewrite rule in the .htaccess that i created:
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1/[L,R]
when i type in http://subdomain-name.example.com i get http://example.com/subdomain-name/
That is fine but what i want to do is type in :
http://subdomain-name.example.com/clientname and have it go to a page ive created called visit.php passing the subdomain-name as "cid" and the clientname as "lid"
i.e.
http://example.com/campaigns/clients/subdomain-name/visit.php?cid=clientname&lid=subdomain-name
what can i do ...
i am baffled and its late... please help if you can,
Thanks
[edited by: jdMorgan at 2:28 pm (utc) on July 28, 2008]
[edit reason] example.com [/edit]
There are also many previous threads on this subject. A site search on "rewrite subdomain to script" and similar phrases will likely turn up some threads that prove useful.
Jim
RewriteRule ^(.*)/(.*)$ [mydomain.com...] [L,R]
but this generates an error
please help
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com [NC]
RewriteRule ^([^/.]+)$ /campaigns/clients/subdomain-name/visit.php?cid=$1&lid=%1 [L]
Jim