Hi,
I'm running into a mod_rewrite problem of the type 'it works on Windows but not on Ubuntu Hardy Linux'. I also cannot seem to be able to activate logging for mod_rewrite so it's really hard to debug the issue.
I have a directory /assets/54/images/sprite.png that needs to be rewritten to the internal directory /assets/images/sprite.png
I have a virtual host assets.mysite.com and I'm currently using .htaccess to block access to the demo site.
This is my code for mod_rewrite
Code:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName assets.mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /usr/share/apache-tomcat-6.0.24/webapps/ROOT/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /usr/share/apache-tomcat-6.0.24/webapps/ROOT/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} assets/.*
RewriteRule ^.*assets/([^/]+)/(.*)$ /assets/$2
</IfModule>
</Directory>
[...]
When I request /assets/10/ I correctly see a directory display with all the subdirectories of /assets. However, when I click on one of the sub directories, e.g. images I get and see the /assets directory again
/assets/10/images
If I click again
/assets/10/images/images etc et etc
Any suggestions are appreciated. Also with regards to getting logging activated. When I insert the logging command in the Virtual host directory, I get an error and when I put it in apache2.conf, I get an empty file.
Very frustrating all in all. And I've run out of things to try.
Cheers,
Marc[/code]