etrader Posted January 24, 2011 Share Posted January 24, 2011 I have a search box with this code <form method="get" action="/search.php"> <div> <input type="text" value="" name="q" size="30" onclick="this.value='';" /> <input type=submit value='Search' "> </div> </form> and .htaccess of RewriteRule ^search/(.*).html search.php?q=$1 [L] Now, if typing "mysite.com/search/$q.html" it works perfectly as well as "mysite.com/search.php?q=$q"; but my problem is that 1. I expect redirecting to "mysite.com/search/$q.html" when typing "mysite.com/search.php?q=$q" (I mean on the browser url place). 2. More importantly, when searching something in the search box, it sends to "mysite.com/search.php?q=$q", but not "mysite.com/search/$q.html" :-\ Link to comment https://forums.phpfreaks.com/topic/225484-redirecting-searchphp-with-htaccess/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.