drewprops
2015-08-11, 00:15
I'm working on a website right now and have some top-level page names like these:
Home
Advisory Services
Project Services
Contact
About
They're pulled from a database that I've created and used as navigation links, with hyphens between the words.
I'm using an htaccess file to do a mod-rewrite so that page URLs are shown like this:
example.com/home
example.com/advisory-services
example.com/management-services
example.com/contact
example.com/about
Standard stuff.
The rewrite rule uses this:
RewriteRule ^/?([a-zA-Z_0-9\-]+)/?$ index.php?bar=$1 [L]
(the contents are escaped inside of '/?' because of the environment)
The index.php page checks to see if a value has been passed:
if (isset($_GET['bar'])) {
$foo=$_GET['bar'];
}
Each of the previously mentioned links passes this check EXCEPT for the one named "advisory-services".
That one is not passed along and gets the warning "No passed variable".
If I go into the database and change a letter in that link to something like "advisory-servicef", it works fine.
Lots of variations have worked, but whenever I change it back to "advisory-services" it fails.
I am supremely confused.
And sleepy.
g'nite
...
Home
Advisory Services
Project Services
Contact
About
They're pulled from a database that I've created and used as navigation links, with hyphens between the words.
I'm using an htaccess file to do a mod-rewrite so that page URLs are shown like this:
example.com/home
example.com/advisory-services
example.com/management-services
example.com/contact
example.com/about
Standard stuff.
The rewrite rule uses this:
RewriteRule ^/?([a-zA-Z_0-9\-]+)/?$ index.php?bar=$1 [L]
(the contents are escaped inside of '/?' because of the environment)
The index.php page checks to see if a value has been passed:
if (isset($_GET['bar'])) {
$foo=$_GET['bar'];
}
Each of the previously mentioned links passes this check EXCEPT for the one named "advisory-services".
That one is not passed along and gets the warning "No passed variable".
If I go into the database and change a letter in that link to something like "advisory-servicef", it works fine.
Lots of variations have worked, but whenever I change it back to "advisory-services" it fails.
I am supremely confused.
And sleepy.
g'nite
...