Jump to content


This topic is now archived and is closed to further replies.


modrewrite question

Recommended Posts

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

Share this post

Link to post
Share on other sites
[!--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...

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 On
RewriteRule ^(.*).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=painter

let me know if you dont get me lol

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.