I have been given a Drupal site which I have to get it running.
I have Apache / Drupal / MySQL up and running, and created a new .conf
file in Active Sites, and set the document location to /var/www/html/
I have edited my hosts file so that I have an entry for
127.0.0.1 samplesite.com
If I browse to samplesite.com/index.php
I see the index of the site. So far so good. It is all styled, and as I see genuine content I must be hitting the database
Now no matter what link I click on on that page, I get a 404 error
. (Looking in the log files its a 404 523 error if that has any bearing on it.)
I then found out the admin userid (using drush), reset the password, and cleared all caches. Still the 404 errors
.
If I go to samplesite.com/user
or samplesite.com/admin
, I still get the 404 error, not an admin login page.
As this is an existing site, and works online, I am blaming something in my setup / configuration (being as the url on a failed link is similar to samplesite.com/about, I am assuming it is in the navigation configuration, but now I am stuck).
Is there an apache url rewriting module (or drupal one?) that needs some configuration? Or can anyone suggest something else I may have overlooked in apache / drupal configuration?
I now have the line $base-url = 'samplesite.com'; in my settings.php file, and none of the other urls work. However it accepts that I am logged in as admin as I have an additional admin menu at the top of the page. (none of the links work though) Curiously, if I disable wifi, then the page doesn't load at all (I wouldn't have thought that wifi on or off would affect localhost)
Ok, My fix came when I followed this thread https://www.drupal.org/node/1572984
I needed to add in the following.
<Directory /var/www/html>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
However I only got here because of the help I received along the way, I think this was just the missing piece.