0
votes

OK, so I'm trying to do a straight redirect:

store.php?StoreLevel=3&PrevStoreLevel=1&productid=6067&Level1=155&p=5&term=&BrowseBy=0

Redirected to:

mynewproductname.html

I'm not looking for a once size fits all rewrite rule, each one of these has a corresponding .html counter part, so kinda "hardcoded"

These are for 301's and Google Rankings

I can't figure this out. All resources I have found give me blanket rules on how to convert all php links in one shot to a html counterpart with the same name. I'm not looking to do this.

I've tried many things, none work. Some of my attempts:

RewriteRule ^store.php?StoreLevel=3&PrevStoreLevel=1&productid=6067&Level1=155&p=5&term=&BrowseBy=0 $ mynewproductname.html [R=301,L]

RewriteCond %{QUERY_STRING} =store.php?StoreLevel=3&PrevStoreLevel=1&productid=6067&Level1=155&p=5&term=&BrowseBy=0 RewriteRule mynewproductname.html [R=301,L]

RewriteCond %{QUERY_STRING} ^StoreLevel=3&PrevStoreLevel=1&productid=6067&Level1=155&p=5&term=&BrowseBy=0$ RewriteRule ^store.php$ http://mysite.com/mynewproductname.html? [R=301,L]

Some of these cause a 500 server error, some just don't work. Assistance is greatly appreciated.

EDIT - mod_rewrite is on and working fine, was able to redirect:

RewriteRule ^foo$ http://mysite.com/testing.html [R=301,L]

With success

1

1 Answers

0
votes

Instead of using .htaccess, you could try redirecting from within your .php file. Have a lookup table of productid => webpage that gets scanned when the .php is first loaded; if you get a match, return a 301. If you don't match, continue on with regular .php processing (or 404, as appropriate)