Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jul 19, 2010 5:43 pm 
Offline

Joined: Mon Jul 19, 2010 5:34 pm
Posts: 1
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]


Top
   
 Post subject:
PostPosted: Sun Aug 15, 2010 2:14 am 
Offline
Newbie

Joined: Wed Jun 16, 2010 11:55 pm
Posts: 2
Website: http://cmdline.org
Location: localhost
I think you want ^.+ not ^.*

and If I'm not mistaken rewrite rules should go inside <directory> tags


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group