* wildcard htaccess 301 redirect

Advert test

Cormac

New Member
#1
I'm trying to setup a redirect so that any request to any page which ends in ?page_id gets redirected to the homepage of the site.
The following rule is placed within the htaccess file but it throws up an internal server error:

Code:
RewriteRule ^?page_id=(.*)$ /http://site.something.com [L,R=301]
Any ideas?
 
#2
Code:
RewriteRule ^?page_id=(.*)$ [COLOR=Red][U][B]/[/B][/U][/COLOR]http://site.something.com [L,R=301]
this doesn't look right, i.e. the forward slash...
 
#3
try this
Code:
RewriteRule ^(.*)?\?page_id=(.*)?$ [URL]http://site.something.com[/URL] [L,R=301]
#or this
RewriteRule ^(.*)?([\?])page_id=(.*)$ [URL]http://site.something.com[/URL] [L,R=301]
also you have a "/" in front of the http:// which shouldn't be there
 
#4
or try this option
Code:
[FONT=Courier New]RewriteCond %{QUERY_STRING} ^page_id=(.*) 
RewriteRule /* [URL]http://site.something.com[/URL][/FONT][FONT=Courier New] [R=301,L][/FONT][FONT=verdana][SIZE=2][/SIZE][/FONT]
 
Top