Mod_rewrite Problems

Hey All,

I am running a Fedora Core 3 server, with Apache/2.0.53 and PHP/
4.3.11, with each user having their own folder under the server (ie '/
home/userOne/public_html' = 'server.com/~userOne')

I am trying to get the mod_rewrite module to work for me.

I have created two files in a test directory - 'test.html' and
'test.php' (as per the tutorial ay http://www.sitepoint.com/article/apache-mod_rewrite-examples ),
and I have created the htaccess file as explained there too (in the
first exercise "The Magic of mod_rewrite")

I have confirmed that mod_rewrite is an active module within Apache.

Access to 'test.php' directly works fine, but access to 'test.html'
returns a 404 error with the following message:
"The requested URL /home/userOne/public_html/rewrite/test.php was not
found on this server."

Has anyone seen this before? What am I doing wrong?

Thanks, in advance,
Luke
lucanos [ So, 30 Dezember 2007 08:17 ] [ ID #1896169 ]

Re: Mod_rewrite Problems

Post removed (X-No-Archive: yes)
Notifier Deamon [ So, 30 Dezember 2007 08:39 ] [ ID #1896172 ]

Re: Mod_rewrite Problems

On Dec 30, 6:39 pm, Davide Bianchi <davideyeahs... [at] onlyforfun.net>
wrote:
> > Has anyone seen this before?
>
> Piles of times,
>
> > What am I doing wrong?
>
> There could be a number of reasons, check your log files, there should
> be a better explanation for the error message, check the permissions
> on your files, be sure your .htaccess is used (directive AllowOverride
> in the directory block), and maybe, just post your rewrite instead of
> pretending that peoples goes looking for it in some webshite.
>
> Davide

Hi Davide,

I have set AllowOverride to "all" at almost every point in the config
file I found it.

htaccess file
----
RewriteEngine on
RewriteRule ^/?test\.html$ test.php [L]

rewrite log file
----
172.27.2.78 - - [30/Dec/2007:18:51:05 +1100] [172.18.7.22/sid#f752ae78]
[rid#f778db20/initial] (3) [per-dir /home/ccnmclab/public_html/
rewrite/] strip per-dir prefix: /home/ccnmclab/public_html/rewrite/
test.php -> test.php
172.27.2.78 - - [30/Dec/2007:18:51:05 +1100] [172.18.7.22/sid#f752ae78]
[rid#f778db20/initial] (3) [per-dir /home/ccnmclab/public_html/
rewrite/] applying pattern '^/?test\.html$' to uri 'test.php'
172.27.2.78 - - [30/Dec/2007:18:51:05 +1100] [172.18.7.22/sid#f752ae78]
[rid#f778db20/initial] (1) [per-dir /home/ccnmclab/public_html/
rewrite/] pass through /home/ccnmclab/public_html/rewrite/test.php

error message
----
Not Found
The requested URL /home/ccnmclab/public_html/rewrite/test.php was not
found on this server.

Thanks
lucanos [ So, 30 Dezember 2007 08:53 ] [ ID #1896174 ]
Webserver » alt.apache.configuration » Mod_rewrite Problems

Vorheriges Thema: Configuring HTTPS
Nächstes Thema: Index only display