Would it be possible to rewrite these:
news.php?id=1004
news.php?action=add
news.php?action=edit&newsid=1004
to
news/1004
news/add
news/edit/1004
With only one RewriteRule ?
Would it be possible to rewrite these:
news.php?id=1004
news.php?action=add
news.php?action=edit&newsid=1004
to
news/1004
news/add
news/edit/1004
With only one RewriteRule ?
I'm not sure about one rule, but you should be okay with something like this to reference the id number or action.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule news/([0-9]+)$ news.php?id=$1
RewriteRule news/add$ news.php?action=add
RewriteRule news/edit/([0-9]+)$ news.php?action=edit&newsid=$1
</IfModule>
This might be condenseable with something like:
# Rewrite news/actionterm/idnum -> news.php?action=actionterm&id=idnum
RewriteRule news/([^/])/([0-9]+) news.php?action=$1&id=$2
Assuming the parameter for viewing viewing and editing can both be id= instead of id= and newsid=.