Jump to content


Photo

modrewrite question


  • Please log in to reply
2 replies to this topic

#1 tatjana

tatjana
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 March 2006 - 12:56 AM

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

#2 Spixxx

Spixxx
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 18 March 2006 - 01:13 AM

Mind re-writting your question? I don't quite understand...

#3 TEENFRONT

TEENFRONT
  • Members
  • PipPipPip
  • Advanced Member
  • 338 posts

Posted 18 March 2006 - 03:00 PM

[!--quoteo(post=356078:date=Mar 17 2006, 08:13 PM:name=Spixxx)--][div class=\'quotetop\']QUOTE(Spixxx @ Mar 17 2006, 08:13 PM) View Post[/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
Teenfront.co.uk : Free Teen Chat -  FunkySmileys.co.uk : MSN Smileys -  ArcadeMonkey.co.uk : Free Flash Games
8Baller.co.uk : Free Multiplayer Pool [url=http://8Baller.co.uk]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users