shmfceliteace
New member
Ok, I am not sure how to phrase this, so please bear with me... (Is that the correct use of "bear"?)
-------
I want to be able to route certain pages to slightly different pages, as long as the requested page is not "index", using regular expressions.
Here is currently how my script will work.
Mod_rewrite is on, allow everything to go through my index.php page...
1st, it will check to see if the pattern matches the current uri. If it does, it precedes to replace the current uri (held within a variable), with the slightly different uri...
Here is what I mean...
If the URL is http://example.com/pages/about_us
And $var = "pages/about_us"
I want $var to become "pages/display/about_us"
(Now, I have all the coding, but I need my RegEx changed....)
here is my current pattern, held within an array:
$settings['routes'][] = array("^pages\/([[:alnum:][
unct:]]*)" => "pages/display/$1");
Here are some examples of what it will match:
"pages/about_us" ---> "pages/display/about_us"
"pages/latest-news" ---> "pages/display/latest-news"
"pages/contactme" ---> "pages/display/contact_me"
But, it will also match:
"pages/index" changing it to: "pages/display/index"
and I do not want it to.
I want it to match everything except the word "index".
So, I am wondering if anyone can help me with the proper RegEx code?
Thanks, and sorry if I am not making much sense...
-------
I want to be able to route certain pages to slightly different pages, as long as the requested page is not "index", using regular expressions.
Here is currently how my script will work.
Mod_rewrite is on, allow everything to go through my index.php page...
1st, it will check to see if the pattern matches the current uri. If it does, it precedes to replace the current uri (held within a variable), with the slightly different uri...
Here is what I mean...
If the URL is http://example.com/pages/about_us
And $var = "pages/about_us"
I want $var to become "pages/display/about_us"
(Now, I have all the coding, but I need my RegEx changed....)
here is my current pattern, held within an array:
$settings['routes'][] = array("^pages\/([[:alnum:][
Here are some examples of what it will match:
"pages/about_us" ---> "pages/display/about_us"
"pages/latest-news" ---> "pages/display/latest-news"
"pages/contactme" ---> "pages/display/contact_me"
But, it will also match:
"pages/index" changing it to: "pages/display/index"
and I do not want it to.
I want it to match everything except the word "index".
So, I am wondering if anyone can help me with the proper RegEx code?
Thanks, and sorry if I am not making much sense...