tatjana Posted March 18, 2006 Share Posted March 18, 2006 Hello all,Compliments for the great forum. Although its my first post it has helped me a lot in the past!I have a little problem here.These are some of my dynamic urls:[a href=\"http://www.mysite/companysearch/search_result.php?search=Browse&category=painter\" target=\"_blank\"]http://www.mysite/companysearch/search_res...ategory=painter[/a][a href=\"http://www.mysite/companysearch/search_result.php?search=Browse&category=builder\" target=\"_blank\"]http://www.mysite/companysearch/search_res...ategory=builder[/a]Thats not excactly the urls search engines like!I would love to change it into:[a href=\"http://www.mysite/companysearch/painter.html\" target=\"_blank\"]http://www.mysite/companysearch/painter.html[/a][a href=\"http://www.mysite/companysearch/builder.html\" target=\"_blank\"]http://www.mysite/companysearch/builder.html[/a]Can somebody help me on this one?Thnx Tatjana Quote Link to comment https://forums.phpfreaks.com/topic/5205-modrewrite-question/ Share on other sites More sharing options...
Spixxx Posted March 18, 2006 Share Posted March 18, 2006 Mind re-writting your question? I don't quite understand... Quote Link to comment https://forums.phpfreaks.com/topic/5205-modrewrite-question/#findComment-18487 Share on other sites More sharing options...
TEENFRONT Posted March 18, 2006 Share Posted March 18, 2006 [!--quoteo(post=356078:date=Mar 17 2006, 08:13 PM:name=Spixxx)--][div class=\'quotetop\']QUOTE(Spixxx @ Mar 17 2006, 08:13 PM) [snapback]356078[/snapback][/div][div class=\'quotemain\'][!--quotec--]Mind re-writting your question? I don't quite understand...[/quote]Aslong as you are using an Apache webserver with mod_rewrite installed - do this.In your companysearch dir create a .htaccess file with this inside :RewriteEngine OnRewriteRule ^(.*).html [a href=\"http://www.mysite/companysearch/search_result.php?search=Browse&category=$1\" target=\"_blank\"]http://www.mysite/companysearch/search_res...ategory=$1[/a]that will make anything type in the (.*) space of the url to be a searchable category EG /painter.html will be rewritten to /search_result.php?search=Browse&category=painteretclet me know if you dont get me lol Quote Link to comment https://forums.phpfreaks.com/topic/5205-modrewrite-question/#findComment-18574 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.