Errors of mod_rewrite

Miroslav Lachman 000.fbsd at quip.cz
Wed Jan 20 15:57:00 UTC 2010


Eugene V. Boontseff wrote:
> I'm testing  the mod_rewrite modul on my server  Apache/2.2.14, FreeBSD
> 7.2-RELEASE-p5.
> the quotation from httpd-vhosts.conf :
>
> <VirtualHost *:80>
> ServerAdmin postmaster at spb.4dk
> DocumentRoot "/usr/local/www/eg1"
> ServerName eg1.spb.4dk
> AcceptPathInfo On
> <Directory "/usr/local/www/eg1">
> AllowOverride FileInfo Options
> Order allow,deny
> Allow from all
> </Directory>
> <Directory "/usr/local/www/egdata1">
> AllowOverride none
> Order allow,deny
> Allow from all
> </Directory>
> php_admin_value mbstring.func_overload 7
> ErrorLog "/var/log/httpd/eg1.error_log"
> CustomLog "/var/log/httpd/eg1.access_log" common
> </VirtualHost>
>
> cat cat
> /usr/local/www/eg1/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom/.htaccess
>
>
> # Testing mod_rewrite full functionality
> Options +FollowSymLinks
> RewriteEngine On
>
> # Uncomment and edit this line as appropriate to reflect your Gallery
> installation.
> RewriteBase
> /usr/local/www/eg1/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom

RewriteBase should be set to URL-path, not a filesystem path:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase

> RewriteRule Rewrite.txt Works.txt [L]
>
> cat
> /usr/local/www/eg1/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom/Rewrite.txt
>
> FAIL_NO_REWRITE
>
> cat
> /usr/local/www/eg1/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom/Works.txt
>
> Ok!
>
> Adressing in broser to the URL:
> http://eg1.spb.4dk/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom/Rewrite.txt
>
>
> get the following failure report:
>
>
> Not Found
>
> The requested URL
> /usr/local/www/eg1/gallery/gallery2/modules/rewrite/data/mod_rewrite/custom/Works.txt
> was not found on this server.
>
> And in the log was written the following:
>
> [[Wed Jan 20 15:30:16 2010] [error] [client 10.200.4.248] File does not
> exist: /usr/local/www/eg1/usr
> ^^^???!!!
> Where a mistake could be?


More information about the freebsd-apache mailing list