Jump to content

mod_rewrite -> virtual subdomain and virtual subfolder at once?


benderr

Recommended Posts

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.