Dealing with optional parameters with mod_rewrite


/ Published in: Apache
Save to your folder(s)

Desired effect is\\r\\n\\r\\nhttp://www.somedomain.com/blog/\\r\\nhttp://www.somedomain.com/blog/tag/\\r\\nhttp://www.somedomain.com/blog/page/2/


Copy this code and paste it in your HTML
  1. RewriteRule ^blog/$ index.php?action=blog [NC,L]
  2. RewriteRule ^blog/page/(.*)$ index.php?action=blog&page=$1 [NC,L]
  3. RewriteRule ^blog/(.*)$ index.php?action=blog&tag=$1 [NC,L]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.