benderr Posted November 18, 2010 Share Posted November 18, 2010 Hi! i am new in this forum. Sorry for any invonvenience. I put this message because i don't find the solution. I am using mod_rewrite for make a virtual subdomains: RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.+)\.mydomain\.com RewriteRule .* index.php?web=%1 [L] All works ok. If I put: cat.mydomain.com -> index.php?web=cat I using mod_rewrite for make virtual subfolders: RewriteRule ^([a-zA-Z0-9]+)/?$ index.php?web=$1 [L,NC] All works ok. If I put: mydomain.com/dog/ -> index.php?web=dog but I need the two things at once! something like that: cat.mydomain.com/dog/ --> index.php?web=cat&web2=dog What can i do? Thank you very much and sorry for any inconvenience. Link to comment https://forums.phpfreaks.com/topic/219105-mod_rewrite-virtual-subdomain-and-virtual-subfolder-at-once/ Share on other sites More sharing options...
benderr Posted November 18, 2010 Author Share Posted November 18, 2010 Solution: RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.+)\.mydomain\.com RewriteRule ^([a-zA-Z0-9]+)/?$ index.php?web=%1&web2=$1 [L,NC] Link to comment https://forums.phpfreaks.com/topic/219105-mod_rewrite-virtual-subdomain-and-virtual-subfolder-at-once/#findComment-1136261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.