Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

server: ubuntu 10.4 running apache2

I have a server with mod_rewrite and it works on my virtual hosts. But I am developing a new site and want to see it on the server before I change the name servers to point to the server. So in the default site config I added

Alias /tester/ "/srv/www/tester.org/wwwroot/"
<Directory "/srv/www/tester.org/wwwroot/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    allow from all
    DirectoryIndex  index.php index.html index.shtml
</Directory>

I can see the site when I go to serverIP/tester/ but with the following .htaccess file I am only getting "page not found" errors for anything but index.php.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /tester/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /tester/index.php [L]
</IfModule>
# END WordPress

I have spent about 2 hours on this but I can't even guess what I am doing wrong here. It seems like this should work. Does anything stand out to anyone?

share|improve this question
    
can you describe what you are trying to do in more detail? –  Tom H May 29 '12 at 20:56
    
is that .htaccess file in /tester or /? –  Tom H May 29 '12 at 20:59
    
.htaccess file is in /srv/www/tester.org/wwwroot/ –  zortacon May 29 '12 at 21:46
    
I want mod_rewrite to work at server-ip-address/tester/ the same way it works if I had tester.org dns pointing to the server. –  zortacon May 29 '12 at 21:47
    
is this an existing VirtualHost configuration for some other website? –  Tom H May 29 '12 at 21:50
show 3 more comments

1 Answer

You've set:

RewriteBase /tester/

But then you're rewriting to the same path:

RewriteRule . /tester/index.php [L]

So, you're rewriting requests to /tester//tester/index.php.

Instead of that, try this:

RewriteRule . index.php [L]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.