I am having a very aggravating problem with Rewrite rules, one in
particular. In the root level of my webserver, I have an .htaccess
file that includes (among others) the following lines:
RewriteEngine On
RewriteBase /
RewriteRule ^nagios[/A-Za-z0-9]* index.php?/categories/8-Nagios
[NC,QSA,L]
there are about a dozen additional RewriteRules following that one,
but they all work properly. This one, however, does not appear to-the
URL gets re-written to something (since otherwise I'd just get a 404
error- /nagios does not exist at all on my webserver), but instead of
ending up where I want to, I end up at the main index page (index.php
rather than index.php?/categories/8-Nagios). What I know:
1) The rewrite portion of the rule is correct. If I copy and paste
the URL into my browser, I end up at the proper page
2) The match is happening on that rule, not one of the following
ones. If I change the rewrite portion to something not on my
webserver, I get a 404 error as would be expected. Same thing if I
remove the rewrite rule entirely.
3) If I add the R flag to the rule, the proper page loads, BUT it
changes the URL in the address bar to index.php?/... which I don't
want. Leaving out the R flag doesn't change the URL in the address
bar, but as already mentioned, I end up in the wrong place
4) This Could be caused by the portion of the url after the
index.php? being wrong- index.php?/RandomText will end up with the
main home page rather than an error. This does not appear to be what
is happening, however- see below.
Looking at the rewrite log shows the following entries:
xxx.xxx.xxx.xxx - - [07/Mar/2007:08:28:03 -0900] [izzy.homeip.net/
sid#1802648][rid#1838c38/initial] (2) init rewrite engine with
requested uri /nagios
xxx.xxx.xxx.xxx - - [07/Mar/2007:08:28:03 -0900] [izzy.homeip.net/
sid#1802648][rid#1838c38/initial] (1) pass through /nagios
xxx.xxx.xxx.xxx - - [07/Mar/2007:08:28:03 -0900] [izzy.homeip.net/
sid#1802648][rid#1838c38/initial] (2) [per-dir /WebServer/Documents/]
rewrite nagios -> index.php?/categories/8-Nagios
xxx.xxx.xxx.xxx - - [07/Mar/2007:08:28:03 -0900] [izzy.homeip.net/
sid#1802648][rid#1838c38/initial] (2) [per-dir /WebServer/Documents/]
trying to replace prefix /WebServer/Documents/ with /
xxx.xxx.xxx.xxx - - [07/Mar/2007:08:28:03 -0900] [izzy.homeip.net/
sid#1802648][rid#1838c38/initial] (1) [per-dir /WebServer/Documents/]
internal redirect with /index.php [INTERNAL REDIRECT]
this would seem to indicate that the rewrite IS happening, and
correctly-the third entry shows nagios being replaced with the proper
index.php string. Those entries, however, are immediately followed by
the normal string of entries for loading the index page. The
http_access log for the same time, shows the following entry:
12.18.177.155 - - [07/Mar/2007:08:28:05 -0900] "GET /nagios HTTP/1.1"
404 12899
followed, again, by a normal load of the index page. This would seem
to indicate that the URL IS NOT being rewriten, but if that was the
case I should get a 404 error page, not the index page (as I do if I
comment out the rewrite rule entirely). So, anyone have any idea what
is going on here, and what I can do to fix it? I have been over the
rewrite docs forward and backward, and I can't find anything that
would indicate what the issue is- as far as I can tell, I have
everything set up properly. I am running Apache 1.3.33 under Mac OS X
10.4.8 Thanks!
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]