Thread tagged as: Question, Configuration, Discussion

Rewrite rule - is this possible?

I have been reading this - and am trying to get my head around the concepts.

I have a 2 page list detail that results in the detail page url: - which looks a bit clunky

My question is, is it feasible to rewrite this to just...

by using an htaccess file with something like...

RewriteRule ^([a-zA-Z0-9-/]+)$ /detailpage.php?s=$1 [L]

Or am I still miles off?



Ben Read

Ben Read 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, but you probably don't want to do it just like that. That rule will match most URLs within your site, making it hard to have anything else. For example


would get rewritten to


which would be unhelpful. Might it be possible to put the detail pages in a subfolder? Otherwise you'll have to add new rewrite rules for every non-detail page you want to have in the site.