Jump to content

URL Rewrite


Recommended Posts

ok guys, Here is the issue.

 

I have a dynaic URL that I need to translate in plain HTML. example URL is as follows.

 

index.php?pg=detail&catTitle=$title

 

I want it translated to be like this

 

www.domain.com/aboutus.html

 

aboutus.html is the value that is passed in catTitle variable. I have writtenthe following code to achieve this.

 

RewriteRule ^detail/(.*)$  /index.php?pg=detail&catTitle=$1 [nc]

 

The result I get is

 

www.domain.com/detail/aboutus.html

 

My main problem is I want to get rid of detail but when I try to remove from the rule, it says no page found. the a href link where I pass these arguments is as follows.

 

<a href="<?=$webPath?>detail/<?= str_replace(' ', '_', $viewcat['cat_Title']).html?>" >

 

can any one guide me how can I get rid of detail and put nothing there.

 

Thanks,

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/104522-url-rewrite/
Share on other sites

Archived

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

×
×
  • 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.