I am in the process of upgrading an old Drupal 6 site to Drupal 8.
I realize Drupal 6 is end of support but need to get the site working on my local Debian box, in order to work with it to get migration moving.
I have exported by Drupal 6 web files and databases and have imported them in my apache2 web server and MySQL Database.
All seems ok except clean urls will not work. If i enable Clean URLs(the DB table has this on from the previous working site) the pages will not resolve. If i update the variable table manually and turn clean urls off the site works.
I have mod rewrite enabled. From the command line, I ran
sudo a2enmod rewrite
I know its enabled as if i run the command again it advised the module is enabled.
i read that you need to run the following too
sudo nano /etc/apache2/sites-available/000-default.conf
Below “DocumentRoot /var/www/html” add the following lines:
<Directory “/var/www/html”>
AllowOverride All
</Directory>
This is my Drupal .htaccess file and i cant see anything causing an issue. It was working fine on the web hosting i had before they upgraded the PHP version of course :-)
#####################
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
<FilesMatch \.php$>
ExpiresActive Off
</FilesMatch>
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id$
I know this can be a pain to resolve but wondered if anyone had any pointers or sugestions?
/etc/apache2/sites-enabled
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory “/var/www/html”>
AllowOverride All
</Directory>
</VirtualHost>
“
and”
characters in your site conf? Remove them. Unfortunately it's hard to tell what's going on exactly not knowing how you configured your local environment. – leymannx Dec 15 '19 at 20:34DocumentRoot
directive pointing to your site's Drupal directory). The file itself should be in/etc/apache2/sites-enabled/
, but it won't be read by Apache unless you have a symlink to it in/etc/apache2/sites-enabled/
. The filename/symlink also needs to end in.conf
. – runswithscissors Dec 16 '19 at 5:42