Jump to content

modrewrite question


tatjana

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
Link to comment
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...
[/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 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
etc

let me know if you dont get me lol
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.