This should be easy, but...

Discuss practical ways rearrange URLs using mod_rewrite.

This should be easy, but...

Postby markpdx1 » Mon Nov 22, 2004 9:44 am

I cant seem to get this to work. I have a site that i moved from asp to php. There are a few old search pages that i need to direct to the new php search pages: My first attempt was:

Trying to direct /sra.asp?s=keyword1 to /cat.php?keyword=keyword1

I'm using -

RewriteRule ^sra\.asp\?s=(.*) /cat.php?keyword=$1

But the rule seems to be ignored as visitors are still getting a 404 from the old .asp page.

Anyone have any ideas what i am doing wrong?
markpdx1
 

Postby seomike » Mon Nov 29, 2004 8:37 pm

RewriteCond %{QUERY_STRING} ^s=(.*)
RewriteRule ^sra\.asp.*$ /cat.php?keyword=%1 [L]

try this
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Thanks!

Postby mbnelson » Fri Jan 07, 2005 2:23 pm

Thanks!, that did it.
mbnelson
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 41 guests

cron