Mod_rewrite not working on ISPConfig 3 Server

10,701

ISPConfig 3 Manual says:

Fast-CGI:

Advantages:

  • Scripts will be executed with user privileges of the web site;
  • More than one PHP version can be run as FastCGI;
  • Might be better in speed compared to CGI and suPHP.

Disadvantages:

  • php.ini values cannot be changed via PHP scripts, vhost files, .htaccess files. But it is possible to use the Custom php.ini settings field on the Options tab of a web site in ISPConfig to specify custom php.ini settings (see chapter 4.6.1.1).

Instead .htaccess file use ISPConfig's Apache Directives:

Site -> Website -> Web Domain -> Options tab

Apache Directives:

DirectoryIndex index.php

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

Drupal 6 INSTALL.txt says:

If the default Drupal theme is not displaying properly and links on the page result in "Page Not Found" errors, try manually setting the $base_url variable in the settings.php file if not already set. It's currently known that servers running FastCGI can run into problems if the $base_url variable is left commented out (see http://bugs.php.net/bug.php?id=19656).

Share:
10,701

Related videos on Youtube

Akahadaka
Author by

Akahadaka

Updated on September 18, 2022

Comments

  • Akahadaka
    Akahadaka over 1 year

    Problem

    I recently migrated a Drupal site from a shared hosting server to my own VM. Everything appears to work correctly, except clean urls.

    My VM Setup

    • Ubuntu 10.04
    • LAMP
    • ISPConfig 3

    What I've tried

    From reading up on a number of drupal forums I've tried the following in this order

    1. Check that mod_rewrite is installed and enabled
    2. Changed PHP from FastCGI to Mod_PHP (prefer to use FastCGI or suPHP though to avoid having tmp/files folders with 777 permissions)
    3. Changed the Redirect type to L in ISPConfig Sites->domain.com->Redirect
    4. Changed /etc/apache2/sites-enabled/000-default

      <Directory /var/www/> 
          Options Indexes FollowSymLinks MultiViews
          AllowOverride All
          ...
      </Directory>
      

    Not sure about points 3 and 4, I do want all domains to be able to use mod_rewrite out of the box.

    Question

    Have I done something wrong or am I missing a step? Ultimately I would like to use FastCGI and clean urls working on all ISPConfig 3 domains without having to make any changes to individual domain settings.

    Any ideas appreciated, I'll try them all.