Problem
GHengeveld |
|
---|---|
Personally I always write the urltrans.dat myself instead of using the admin panel. That has always given me much better results, probably because I've never really understood the admin interface for this.
It is actually very simple. You just have to make sure that your .htaccess rules match up with the urltrans rules. The most generic rules (* * {$_area}.php being the absolute most generic) should always be at the bottom. For example: admin m=* admin/{$m} admin * admin pm * pm users * members index * home rss * rss * * {$_area}.php The first item (column) on the line is the name of the file (script) you're writing the rule for, so forums.php becomes forums. The second item is the query string you want to match, but leaving off the questionmark at the beginning. A variable in your .htaccess is an asterisk (*) in urltrans.dat. The third item is what the url will come to look like after the transformation. This is what the .htaccess rewriterule should match. You can call a query string parameter from the second item by preceding it with a dollar sign ($) and enclosing it with accolades. See the first line in the example above: m=* becomes {$m} Here's a more complicated rule (first the urltrans.dat line, then the .htaccess rule): plug e=userresults&u=*&resid=*&m=scores {$u}/scores/{$resid} RewriteRule ^(.*)/scores/([0-9]+)$ plug.php?e=userresults&u=$1&resid=$2&m=scores [NC,NE,QSA,L] I hope this helps. Don't forget that items/columns must be separated by one tab. |
|
Відредаговано: Koradhil (05.10.2010 04:32, 14 років тому) |