Jump to content

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

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.