RewriteEngine - Debian Sarge - Apache2

Discussion in 'Installation/Configuration' started by DerLobo, Jul 3, 2006.

  1. DerLobo

    DerLobo New Member


    this is weird and I read already all related threads here!

    I try to figure out, that mod_rewrite change the URL for me.

    I add a web domain.tld

    Inside I put a .htaccess with the rewrite rules.
    Everything is fine and work prefectly.
    Now I create an additionally web
    This is a subdomain of domain.tld but have a own web.

    The .htaccess inside the folder
    show no effect.

    No errors, nothing!

    For domain.tld I do no changes in the apache2.conf
    Just out the .htaccess inside the folder and it is running.

    What can I do, that the rewrite rules working for the subdoman?

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule reise/(.+)(/)? index.php?reise=$1 [L]
    All I want is:
    looks like:
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Does it work if you put your rewrite code in the apache directives field of the website instead of an .htaccess file?
  3. DerLobo

    DerLobo New Member

    No, sorry. This doesn't work, too.

    I'm not very familar with rewriting ;)

    switch ($_GET['reise'])
      case 'Singlereise':
      case 'Lastminute_Reisen_komplett':
      // welcome screen
        include ('masken/start.php');
    Here is what I try to do.

    Maybe my code is not good for rewrite? I have no clue.
  4. falko

    falko Super Moderator ISPConfig Developer

    Anything in the Apache error log?
    Can you post the vhost configuration of the subdomain?
  5. TheRudy

    TheRudy ISPConfig Developer ISPConfig Developer

    try adding 'RewriteBase /'

    RewriteEngine  on
    RewriteBase    /
    RewriteRule ^reise/([A-Za-z]+)/?$ index.php?reise=$1
  6. DerLobo

    DerLobo New Member

    Thanks a lot. RewriteBase does not help. I tried this many times before.

    The Apache log show no errors.
    Only some not found sites, but this is ok, because I changed the urls.

    One error is multiple times into the apache error log:
    [error] an unknown filter was not added: PHP
    And here is the vhost configuration for this host:
    ServerName travel.domain.tld:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web10/web
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.jsp Default.htm default.htm
    ScriptAlias  /cgi-bin/ /home/www/web10/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web10/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    <Files *.php3>
        SetOutputFilter PHP
        SetInputFilter PHP
    <Files *.php4>
        SetOutputFilter PHP
        SetInputFilter PHP
    <Files *.php5>
        SetOutputFilter PHP
        SetInputFilter PHP
    php_admin_flag safe_mode On
    php_admin_value open_basedir /home/www/web10/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /home/www/web10/phptmp/
    php_admin_value session.save_path /home/www/web10/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    AddType application/vnd.wap.wmlscriptc .wmlsc .wsc
    AddType text/vnd.wap.wml .wml
    AddType text/vnd.wap.wmlscript .ws .wmlscript
    AddType image/vnd.wap.wbmp .wbmp
    Alias /error/ "/home/www/web10/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web10/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web10/user/$1/web/$3
    And here the part taken from apache2.conf
    <Files ~ "^\.ht">
        Order allow,deny
        Allow from all
    <Directory /home/www/*/user/*/web>
        Options +Includes -Indexes
        Options FollowSymLinks
        AllowOverride All
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
        <Files ~ "^\.ht">
        Deny from all
    #<Directory /home/www/web10/web>
    #       Options Indexes FollowSymLinks
    #       AllowOverride All
    #       Order allow,deny
    #       Allow from all
    #       RewriteEngine on
    The part for web10 (this is the web which make problems I have comment out, because this was also not working.
  7. DerLobo

    DerLobo New Member


    thanks for your help and sorry for your wasted time.

    Everything is working.
    As everytime, the problem was sitting round about 60 cm before the screen ;)

    My script is not good for the rewrite modus.
    Now I tried already an other one and all is working fine.

    No changes in vhost or configuration was required.
  8. falko

    falko Super Moderator ISPConfig Developer

Share This Page