ISPCONFIG 3 / .htaccess/ rewrite

Discussion in 'General' started by skippy59, May 14, 2014.

  1. skippy59

    skippy59 New Member

    Hi,

    I 've installed a web app that needs url rewriting. This .htaccess works well on a non ispconfig server :

    Options -Indexes FollowSymLinks MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?prado_path_info=$1&%{QUERY_STRING} [L]

    but doesn't work on ispconfig

    I've had manually apache2 directives in the ISPconfig interface :

    <Directory /var/www/mercier-automobiles.local/web>
    AllowOverride All
    </Directory>

    <Directory /var/www/clients/client7/web7/web>
    AllowOverride All
    </Directory>

    et here is the vhost conf file:

    <Directory /var/www/mercier-automobiles.local>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost XXX.XXX.XXX.XXX:80>
    DocumentRoot /var/www/mercier-automobiles.local/web

    ServerName mercier-automobiles.local
    ServerAlias www.mercier-automobiles.local
    ServerAdmin webmaster@mercier-automobiles.local

    ErrorLog /var/log/ispconfig/httpd/mercier-automobiles.local/error.log

    Alias /error/ "/var/www/mercier-automobiles.local/web/error/"
    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 502 /error/502.html
    ErrorDocument 503 /error/503.html

    <IfModule mod_ssl.c>
    </IfModule>

    <Directory /var/www/mercier-automobiles.local/web>
    Options +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /var/www/clients/client7/web7/web>
    Options +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>




    # suexec enabled
    <IfModule mod_suexec.c>
    SuexecUserGroup web7 client7
    </IfModule>
    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    # php as fast-cgi enabled
    # For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
    <IfModule mod_fcgid.c>
    IdleTimeout 300
    ProcessLifeTime 3600
    # MaxProcessCount 1000
    DefaultMinClassProcessCount 0
    DefaultMaxClassProcessCount 100
    IPCConnectTimeout 3
    IPCCommTimeout 600
    BusyTimeout 3600
    </IfModule>
    <Directory /var/www/mercier-automobiles.local/web>
    <FilesMatch "\.php[345]?$">
    SetHandler fcgid-script
    </FilesMatch>
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php3
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php4
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php5
    Options +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /var/www/clients/client7/web7/web>
    <FilesMatch "\.php[345]?$">
    SetHandler fcgid-script
    </FilesMatch>
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php3
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php4
    FCGIWrapper /var/www/php-fcgi-scripts/web7/.php-fcgi-starter .php5
    Options +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>


    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
    AssignUserId web7 client7
    </IfModule>

    <IfModule mod_dav_fs.c>
    # Do not execute PHP files in webdav directory
    <Directory /var/www/clients/client7/web7/webdav>
    <ifModule mod_security2.c>
    SecRuleRemoveById 960015
    SecRuleRemoveById 960032
    </ifModule>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    </Directory>
    DavLockDB /var/www/clients/client7/web7/tmp/DavLock
    # DO NOT REMOVE THE COMMENTS!
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
    # WEBDAV BEGIN
    # WEBDAV END
    </IfModule>

    <Directory /var/www/mercier-automobiles.local/web>
    AllowOverride All
    </Directory>

    <Directory /var/www/clients/client7/web7/web>
    AllowOverride All
    </Directory>
    </VirtualHost>


    Thanks for help
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Does it work when you take away the Option line from the .htaccess?
     
  3. skippy59

    skippy59 New Member

    No it doesn't work

    here is the rewrite log :

    XXX.XXX.XXX.XXX - - [14/May/2014:15:36:20 +0200] [www.mercier-automobiles.local/sid#b74cc018][rid#b23c5058/initial] (3) [perdir /var/www/mercier-automobiles.local/web/] strip per-dir prefix: /var/www/mercier-automobiles.local/web/index.php -> index.php
    XXX.XXX.XXX.XXX - - [14/May/2014:15:36:20 +0200] [www.mercier-automobiles.local/sid#b74cc018][rid#b23c5058/initial] (3) [perdir /var/www/mercier-automobiles.local/web/] applying pattern '^(.*)$' to uri 'index.php'
    XXX.XXX.XXX.XXX - - [14/May/2014:15:36:20 +0200] [www.mercier-automobiles.local/sid#b74cc018][rid#b23c5058/initial] (4) [perdir /var/www/mercier-automobiles.local/web/] RewriteCond: input='/var/www/mercier-automobiles.local/web/index.php' pattern='!-d' => matched
    XXX.XXX.XXX.XXX - - [14/May/2014:15:36:20 +0200] [www.mercier-automobiles.local/sid#b74cc018][rid#b23c5058/initial] (4) [perdir /var/www/mercier-automobiles.local/web/] RewriteCond: input='/var/www/mercier-automobiles.local/web/index.php' pattern='!-f' => not-matched
    XXX.XXX.XXX.XXX - - [14/May/2014:15:36:20 +0200] [www.mercier-automobiles.local/sid#b74cc018][rid#b23c5058/initial] (1) [perdir /var/www/mercier-automobiles.local/web/] pass through /var/www/mercier-automobiles.local/web/index.php
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    From what I see in the rewrite log, the rewrite is working correctly.
    What about logs from other url calls (not just calling / or /index.php)?
     

Share This Page