never_rain Posted May 7, 2008 Share Posted May 7, 2008 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 More sharing options...
never_rain Posted May 7, 2008 Author Share Posted May 7, 2008 Further to this, I have modified the conditions to this. RewriteRule ^/(.*)$ /sitewonders/index.php?pg=detail&catTitle=$1 [nc] and it gives me Page Not Found error. the url shown in the link is good but not displaying the page.. help plz Link to comment https://forums.phpfreaks.com/topic/104522-url-rewrite/#findComment-535046 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.