September 5th, 2008, 07:58 AM
Optional portion of Regular Expression
I am currently using the rollowing RewriteRule;
I basically want to be able to have an optional part of the url between "admin" and "news". For instance;
RewriteRule ^admin/news/edit/([0-9]+)/$ admin/news.php?sitePage=news&pageSection=newsForm&nId=$1
but still wrapping it all up in the same line, rather than creating an extra line for each additional defintion.
Regards, Matt Lowden
September 5th, 2008, 02:44 PM
Do you want to do something with that "value"? Or just throw it away?
What all is allowed in there? Anything? Just letters and numbers? Is there a specific list of things it can be?
September 9th, 2008, 05:56 AM
Originally Posted by BlazerRotare
I think the expression ^admin/(.+\/)*edit/([0-9]+)/$ should do it