• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

mod_rewrite, cataching exceptions

Is there a better way to structure these rewrite rules?


RewriteEngine On
RewriteRule ^users$ users_overview.php
RewriteRule ^users/$ users_overview.php
RewriteRule ^users/[0-9]?$ users_overview.php?customer=$1 [NC,L]
RewriteRule ^users/([^/\.]+)/?$ users_overview.php?customer=$1 [NC,L]
RewriteRule ^users/([^/\.]+)/([^/\.]+)?$ users_overview.php?customer=$1&pageno=$2 [NC,L]
RewriteRule ^users/([^/\.]+)/([^/\.]+)/?$ users_overview.php?customer=$1&pageno=$2 [NC,L]

Open in new window

0
krv123
Asked:
krv123
  • 3
1 Solution
 
David S.Commented:
Try this:
RewriteEngine On
RewriteRule ^users/?$ users_overview.php
RewriteRule ^users/([^/\.]+)/?$ users_overview.php?customer=$1 [NC,L]
RewriteRule ^users/([^/\.]+)/(([^/\.]+)/?)?$ users_overview.php?customer=$1&pageno=$3 [NC,L]

Open in new window

0
 
krv123Author Commented:
Will it catch any forward slashes?
0
 
krv123Author Commented:
correction if there are not any forward slashes
0
 
krv123Author Commented:
it works thanks.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now