Home > Default > Mod_rewrite RewriteRule's not working...

Mod_rewrite RewriteRule's not working...

December 10Hits:5
Advertisement
i'm trying to utilize mod_rewrite on my OS X 10.4.8 server but even the simplest rule isn't being executed. not sure how to read my rewrite .log but it looks like all my rules / "pattern" are being applied to '/server-status' ?
i've tried to write rules in the .htaccess file but these don't seem to be recognized either.
thanks for any advice or direction,
./james
mod_rewrite settings for "httpd.conf"
LoadModule rewrite_module libexec/httpd/mod_rewrite.so
AddModule mod_rewrite.c
<IfModule mod_rewrite.c>
RewriteLog "/var/log/rewrite.log"
RewriteLogLevel 9
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
# this simple rule james.html --> emit.html doesn't work...
RewriteRule ^james\.html$ emit.html
RewriteRule ^/page/(.*)$ /cgi-bin/WebObjects/PWDA.woa/wa/loadPage?pageId=$1 [L,PT,QSA]
</IfModule>
output from "rewrite.log"
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (2) init rewrite engine with requested uri /server-status
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (3) applying pattern '.*' to uri '/server-status'
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (4) RewriteCond: input='GET' pattern='^TRACE' => not-matched
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (3) applying pattern '^/page/(.*)$' to uri '/server-status'
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (1) pass through /server-status
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (2) init rewrite engine with requested uri /server-status
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (3) applying pattern '.*' to uri '/server-status'
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (4) RewriteCond: input='GET' pattern='^TRACE' => not-matched
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (3) applying pattern '^/page/(.*)$' to uri '/server-status'
127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (1) pass through /server-status

Answers

The log entries are a red herring.
If you look at the first line of the log:
<pre class=command>127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (2) init rewrite engine with requested uri /server-status</pre>
This is mod_rewrite's way of telling you that it just saw a request for /server-status - that is the request from the client.
It then walks through the rules and none of them apply so it exits with:
<pre class=command>127.0.0.1 - - [05/Jan/2007:10:18:52 -0500] [127.0.0.1/sid#1802648][rid#18b3038/initial] (1) pass through /server-status</pre>
In other words, none of the rules match, so the request passes through.
Nowhere here do I see a hit that matches the rules and would therefore get rewritten.
What happens if you actually hit http://localhost/page/something ? does it get rewritten?

Read other 2 answers

Tags:

Related Articles

  • Mod_rewrite RewriteRule's not working...December 10

    i'm trying to utilize mod_rewrite on my OS X 10.4.8 server but even the simplest rule isn't being executed. not sure how to read my rewrite .log but it looks like all my rules / "pattern" are being applied to '/server-status' ? i've tried to wri

  • Removing GSF after upgrade to 11.1.1.8October 11

    Hi, We are currently running WebCenter Sites 11.1.1.6 with GSF in our environments. We wish to upgrade to 11.1.1.8. WCS 11.1.1.8.0 includes vanity URL support. So we want to remove the GSF during this upgrade. I have following questions - ·         W

  • How Can I get mod_rewrite to run on 10.6.4?October 11

    Hi there, I've carried over a local wordpress install for some debug/dev purposes on to my local comp and encountered a few issues in getting permalink/mod_rewrite functions to run cleanly. I've noticed there's a number of posts in this forum about t

  • Problem With httpd.conf and mod_rewrite rules Apache 2.2October 11

    I have some RewriteRules that are working on my Leopard Client Apache 2.2 machine - but when I try to implement them on Leopard Server Apache 2.2, they don't work. I don't get any errors, they just won't execute. Could somebody with Leopard Server he

  • Mod_jk in combination with mod_rewriteOctober 11

    My question is wtf doesn't this work? I'm using apache 1.3.27 and jboss-3.0.4_tomcat-4.1.12 mod_jk works fine. I tried adding in mod_rewrite and now when I go to a page that gets rewritten, the mod_jk doesn't SEE the new URI. Instead, it still uses t

  • How can I use mod_rewrite to do a private redirect to a servletOctober 11

    I am trying to use the mod_rewrite to send any request from http://www.myhost.com/thispath/here/servletname?parms... to http://www.myhost.com/servlets/myservlets/servletname?parms... without changing the URL that the end-user sees... using the follow

  • Apache + mod_rewriteOctober 11

    i've got a problem with mod_rewrite - it doesn't work. (~)$ cat /etc/httpd/conf/httpd.conf| grep mod_rewrite LoadModule rewrite_module modules/mod_rewrite.so (~)$ cat /home/httpd/html/.htaccess Options FollowSymLinks RewriteEngine On RewriteRule ^ind

  • Rewrite rules: mod_rewrite vs. SJWS 7October 11

    Hi, I migrate some application which uses mod_rewrite. And I have a serious problems with write correct rules in obj.conf. I need to implement two task (below): 1. some like below RewriteRule ^/$ http://test1.domain.com/index.dhtml [R=301,L] RewriteR

  • Apache mod_rewrite and mod_wl togetherOctober 11

    Hi everybody, I'm having a problem with apache (1.3.27 on linux) mod_rewrite and mod_wl. The httpd.conf looks like this: RewriteEngine on RewriteCond %{QUERY_STRING} Id=100 RewriteRule ^/dynamic/tops$ /static/100.html [P] <Location /dynamic> SetHand

  • Problem with mod_rewriteOctober 11

    I have been trying to work on mod_rewrite for our site. I did get some VERY good help on the mod_rewrite forum but now I am hitting a wall trying to use the [P,L] condition on my Xserve. ( [L] alone works) Here is my issue from the other forum: http:

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 1.086 s.