Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have added these lines in my 000-default virtual host file:

Alias /antoniocs/project "/home/antoniocs/www/project"
<Directory "/home/antoniocs/www/project">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all

/home/antoniocs/www/project Contains a drupal website

If I go to:


This works out fine. I see everything perfectly. But when I try to click on a link that takes me, for example, to:


I get this error:

Not Found

The requested URL /home/antoniocs/www/project/index.php was not found on this server.

Is this not processing the .htaccess that is in the project folder? What am I doing wrong???

NOTE: I also find it strange that it's giving me a file path and not an url path

Running on Apache 2.2.16 (with mod rewrite) Ubuntu 10.10 php 5.3.3-1ubuntu9.1

EXTRA NOTE: For those that don't know drupals htaccess, it redirects everything to index.php?q=$1

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !=/favicon.ico

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

share|improve this question
add comment

3 Answers

It sounds like a rewrite is taking place in the wrong location. For example, the webserver is trying to find the URL /home/antoniocs/www/project/index.php instead of the local file by the same path. Perhaps check the Drupal installation itself? You can check what the server thinks by looking at the requests for redirection using something like curl:

curl -I http://localhost/antoniocs/project/category

See if code 301 or 302 is returned, and that may help narrow down the problem. E.g.:

$ curl -I http://www.outflux.net/blog
HTTP/1.1 301 Moved Permanently
Location: http://www.outflux.net/blog/
share|improve this answer
The code returned is 404 :( –  AntonioCS Nov 10 '10 at 10:50
add comment

Alternatively you can also enable userdir module of apache. So that you don't have to create an alias to access the codes that resides in your home directory

sudo a2enmod userdir
cd ~
mkdir public_html
sudo /etc/init.d/apache2 restart

Put your code under this public_html and you can access it by http://localhost/~username or http://ipaddress/~username (for example: http://localhost/~aneesh)

You can change the directory name(public_html) by editing the conf file /etc/apache2/mods-enabled/userdir.conf

share|improve this answer
Thanks for this tip. I edited the userdir.conf and changed public_html to www but apache does not seem to reload the module configurations. Do I need to disable and enable the module for the new configurations to take effect? Also I tried putting a php file in the public_html (just to test it) and it sent me the file instead of running the php file –  AntonioCS Nov 10 '10 at 11:18
Ok I figured out what the problem was I forgot to change the UserDir. I keep having the same problem with clean urls, apparently the .htaccess is not being read –  AntonioCS Nov 10 '10 at 11:32
i assume that you are running php. Just have a look at /etc/apache2/mods-enabled/php5.conf. and comment the following section if it is not already done. <IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine Off </Directory> </IfModule> </IfModule> –  aneeshep Nov 22 '10 at 6:25
add comment

See if anything here can help: https://drupal.org/node/163915, your problem may have something to do with the AllowOverride statement in; /etc/apache2/sites-available/default

share|improve this answer
add comment

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.