You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Stickland <ts...@gmail.com> on 2006/08/18 14:00:48 UTC

[users@httpd] mod_rewrite, windows problems

Hi

I'm having real trouble getting mod_rewrite to run properly on my Windows
machine. These are the directives stored in an htaccess file in the root
directory:

<htaccess>

DirectoryIndex home.php index.php index.html

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . %{REQUEST_FILENAME}.php [L]
RewriteCond %{REQUEST_URI} !(.*)/$

</htaccess>

This works as expected on a unix web server (rewrites '
server.com/about_us.php' to 'server.com/about_us') but generates the
following error on my Windows machine:

"You don't have permission to access /E:/Web/id_web/about_us.php on this
server."

The server log says:

"[Fri Aug 18 12:54:48 2006] [error] [client 127.0.0.1] (20023)The given path
was above the root path: Cannot map GET /about_us HTTP/1.1 to file, referer:
http://id.com/"

Anyone any ideas please?

Thanks
Tim


Apache 2.2
Windows XP Pro

Re: [users@httpd] mod_rewrite, windows problems

Posted by Bob Ionescu <ro...@googlemail.com>.
Tim Stickland wrote:
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . %{REQUEST_FILENAME}.php [L]

Don't use a physical path here, use r->uri instead.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ %{REQUEST_URI}.php [L]

-- 
Robert

---------------------------------------------------------------------
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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org