Hi everyone!

I'm experiencing problems in my Drupal instalation.

I just can visit the homepage, if I click on a internal link I just see a 404 error page...

I've tried to upload a single php file and I can see it without problems.

I think it's a Drupal problem because links to internal php and html files work fine.

In the other hand, external links also work fine...

You can test it here: http://www.konamito.com

Thanks in advance!

Andrés.

Comments

cog.rusty’s picture

Notice that:

http://www.konamito.com/node/19 doesn't work
http://www.konamito.com/?q=node/19 works

You have enabled clean URLs in admin/settings/clean-urls, so Drupal uses them in the menus, but your server isn't ready to support them.

Make sure that:
- You have Drupal's .htaccess file
- Apache has mod_rewrite enabled in httpd.conf
- Apache is configured to use .htaccess files (*not* "AllowOverride None" in httpd.conf)

Until you solve the problem, you can go to http://www.konamito.com/?q=admin/settings/clean-urls and disable clean URLs so that Drupal won't try to use them in the menus.

Konamito’s picture

Thanks for the fast reply!!!

I've checked that my .htaccess file wasn't there! I found this code and I created my own .htaccess file for Drupal:

RewriteEngine on
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Now things seem to work right, but I would like to know if this .htaccess file is correct or I need to add something else.

Thanks again for your help.

cog.rusty’s picture

This contains all that is needed for clean URLs to work.

Of course you can upload a fresh .htaccess file from a Drupal package same version as yours, which contains some more settings and some useful comments about things that you can do.

Konamito’s picture

Thanks again for your help.

This weekend I'm going to update so I think the new .htaccess file is fine for the site, right?

Regards.

Andrés.

stickyBandit’s picture

Thanks for this help, it was the mod_rewrite that was failing for me.

What caused this?

Initially I had tried, through running the *.msi file for php install, to enable the GDLibraries (since my drupal install was reporting that wasn't turned on). This caused Apache to not restart. So I took what I guess was the long way around, i uninstalled php, and apache, reinstalled and re-configured. After a while of tweaking, I was able to get the site to load as per the title of this page: no links worked, they would just go to the front page site.

I enabled the mod_rewrite in apache's httpd.conf as per the suggestion by cog.rusty and all works now.

Thanks for the help!

onid_way’s picture

I had the same problem!!

Thanks for the info!! ;)

vineetkumar03’s picture

1. Following entry shoud be Under virtual host

<VirtualHost *:80>
  <Directory /var/www/html>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Require all granted
  </Directory>
</VirtualHost>

And Restart apache service (systemctl restart apache2)
2. Enable mod_rewrite
sudo a2enmod rewrite
sudo systemctl restart apache2
3. .htaccess shoul be present in doc root
4. php mbstring should be enabled.