how do I apply a rewrite rule to 300+ websites?

Discuss practical ways rearrange URLs using mod_rewrite.

how do I apply a rewrite rule to 300+ websites?

Postby RC3 Media » Fri Aug 14, 2009 4:30 pm

Im working on a rewrite rule that I would like to apply to all the vhosts on a particular server.The rule is very simple, used for pagination and is not the issue here. It works when placed inside of the htaccess file, but not inside the httpd.conf file(ubuntu linux server).

Where would I place a "global" rule that would apply to all of the sites?

Heres the rule:

RewriteEngine on
RewriteRule ^(.*)page([0-9]+)\.html$ $1?tpage=$2 [L]

Im sure theres a simple solution, please help!!!
RC3 Media
 
Posts: 2
Joined: Fri Aug 14, 2009 4:17 pm

Postby richardk » Sun Aug 16, 2009 6:58 am

Have you got a
Code: Select all
RewriteEngine On

with it?

If that doesn't work/you already have it try adding
Code: Select all
RewriteOptions Inherit

to the <VirtualHost>s (a few to test).
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Where do I add the rewrite code.

Postby RC3 Media » Tue Aug 18, 2009 11:04 am

I have turned the rewrite engine on.

Do I have to place the code inside of a <Directory>??
RC3 Media
 
Posts: 2
Joined: Fri Aug 14, 2009 4:17 pm

Postby richardk » Tue Aug 18, 2009 4:00 pm

No, inside the <VirtualHost>.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 22 guests

cron