Home mod_rewrite rule specific to page
Reply: 0

mod_rewrite rule specific to page

user755 Published in May 21, 2018, 12:42 pm

I have the following page structures:

  1. domain.com/page.php?cat=hello&url=world
  2. domain.com/careers.php?cat=careers&url=careers
  3. domain.com/article.php?cat=blog&url=this-blog-name

I would like them to work as follows:

  1. domain.com/hello/world.html
  2. domain.com/careers/careers.html
  3. domain.com/blog/this-blog-name.html

I tried the following without success (mod_rewrite is enabled and confirmed working):

RewriteRule ^([^/]*)/([^/]*)\.html$ /careers.php?cat=$1&url=$2 [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ /page.php?cat=$1&url=$2 [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ /article.php?cat=$1&url=$2 [L]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300935 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO