change the url of a research

Discuss practical ways rearrange URLs using mod_rewrite.

change the url of a research

Postby robs » Tue Jul 08, 2008 10:07 pm

if, after a click on search button, in the url there is

www.sitename.com/research/sector1/word-that-you-search

how is possible to see in the url not sector1 but s1
www.sitename.com/research/s1/word-that-you-search

in the url should appear s1 but for to work at server browser
must to send always sector1; so think this is a different solution
respect at rewrite rule for a simple page


seem that isn't possible;

I tested:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^research/s1(/(.*))?$ /research/sector1/$1 [QSA,L]


I tested also with no initial slash
RewriteRule ^research/s1(/(.*))?$ research/sector1/$1 [QSA,L]
but not work


also tested (/.*) instead of (/(.*))
RewriteRule ^research/s1(/.*)?$ research/sector1/$1 [QSA,L]
robs
 
Posts: 25
Joined: Sat Jun 03, 2006 4:23 am

Postby richardk » Wed Jul 09, 2008 2:02 pm

You have to change the <form> action="". Mod_rewrite does not change the URL in the source of the page.
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 34 guests

cron