PDA

View Full Version : mod_rewrite ?



Todd W
11-06-2007, 06:07 PM
I have:
RewriteRule ^large.php http://www.mysite.com/ [L,R=301]

It works.
But if it looks like large.php?something=blah it won't 301.

I tried ^large.php$ and it didn't work. also Tried ^large.php.*$

Anyone have any ideas?

-Todd

KLB
11-06-2007, 06:40 PM
I have:
RewriteRule ^large.php http://www.mysite.com/ [L,R=301]

It works.
But if it looks like large.php?something=blah it won't 301.

I tried ^large.php$ and it didn't work. also Tried ^large.php.*$

Anyone have any ideas?

-Todd

It should read:
RewriteRule ^large.php http://www.mysite.com/ [R=301,QSA,L]

Todd W
11-06-2007, 07:18 PM
It should read:
RewriteRule ^large.php http://www.mysite.com/ [R=301,QSA,L]

That doesn't work.

rpanella
11-06-2007, 07:33 PM
What you have should work. Are there any other rules that might be messing it up?
________
TOYOTA PZ ENGINE SPECIFICATIONS (http://www.toyota-wiki.com/wiki/Toyota_PZ_engine)

KLB
11-06-2007, 09:19 PM
Do you have the following instruction in your .htaccess file?

RewriteEngine on

The QSA is required to append any querystrings to a request.

Here are some real rewrite instructions I use in my .htaccess file:


RewriteRule ^(actinium|ACTINIUM|Actinium)(.*) /yogi/periodic/Ac.html [R=301,L]
RewriteRule ^blog/(.*)?$ http://blog.environmentalchemistry.com/$1 [R=301,QSA,L]
RewriteRule ^links/srad(.[0-9]+)mrurl/bak/(.*) http://banners.aftrk.com/$2 [R=301,QSA,L]