php - htaccess isn't doing what I wanted it to do -
#### administration panel #### rewriterule ^administration/main administration/index.php [l] ## administration - main rewriterule ^administration/members/list administration/members.php?list=view [l] ## administration - user list rewriterule ^administration/members/reports administration/members.php?reports=view [l] ## administration - user reports rewriterule ^administration/members/banned administration/members.php?banned=view [l] ## administration - user banned rewriterule ^administration/members/list/page([^/]*)$ administration/members.php?list=view&page=$1 [l] ## administration - user list - pagination rewriterule ^administration/members/reports/page([^/]*)$ administration/members.php?reports=view&page=$1 [l] ## administration - user reports - pagination rewriterule ^administration/members/banned/page([^/]*)$ administration/members.php?banned=view&page=$1 [l] ## administration - user banned - pagination
if use direct link "administration/members.php?list=view&page34 works..... nope, not htaccess rewrites, total bs. me?
the thing have remember rewrite rules regular expression matchers. issue pattern
^administration/members/list
will match url
http://example.com/administration/members/list/page34
before rule
^administration/members/list/page([^/]*)$
i suggest put eol anchor ($
) on first set of patterns if that's match, eg
rewriterule ^administration/main$ administration/index.php [l] rewriterule ^administration/members/list$ administration/members.php?list=view [l] rewriterule ^administration/members/reports$ administration/members.php?reports=view [l] rewriterule ^administration/members/banned$ administration/members.php?banned=view [l]
i suggest use qsa
flag not lose query string information.
update
an better idea combine first set of rules paged equivalents. example
rewriterule ^administration/members/list(/page(\d+))? administration/members.php?list=view&page=$2 [l,qsa]
this end this...
administration/members/list => administration/members.php?list=view&page= administration/members/list/page34 => administration/members.php?list=view&page=34
Comments
Post a Comment