Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/"
<Directory "/srv/www/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    allow from all
    DirectoryIndex  index.php index.html index.shtml

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]
# 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/ – 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 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

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

Your Answer


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.