mod_rewrite Help

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

I am working a site and need something fairly complicated from mod_rewrite

The core PHP files will be powering 8 different versions of the site. The content will change depending on the version of the site.

The URLs will be in the format www.siteurl.com/sitename

Where sitename will change for each version.

Basically what I need to do is to make all of the pages work through that URL.

For example - this is the code to get the front page displaying

Code:
RewriteEngine on
RewriteRule ^sitetwo/$ /index.php?site_id=2

This is easy enough but I dont want to have to create a rule for each one.

So I need some code that is going to redirect the whole lot - whilst retaining the query strings that are used. Thats where I get stuck.

Can anyone suggest anything that might help?

Thanks
Aaron
 
Hey

Thanks for the reply

I could use the sitename and then just use some code to get the ID from the site name

I don't mind replicating the rewrite rules for each site - just don't want to have to write a rule for every file within that site - if that makes sense

Cheers
Aaron
 
Back
Top Bottom