• Solution multisite htaccess cleanURL


    My solution to getting Clean URL working with my multisite setup drupal 4.7

    I added Alias to my httpd.conf apache file:

    <VirtualHost *:80>
        # Alias for all php drupal sites
        Alias /abc /var/www/html/drupal
        Alias /def /var/www/html/drupal
        Alias /xyz /var/www/html/drupal
    </VirtualHost>

    My setup has 4 sites /drupal, /abc, /def, /xyz all files are in the /drupal directory

    • url=/drupal (sites/default/)
    • url=/abc (sites/localhost.abc/)
    • url=/def (sites/localhost.def/)
    • url=/xyz (sites/localhost.xyz/)

    In the /drupal/.htacess file. I added a RewriteCond %{REQUEST_URI} condition for
    each site, and so have separate RewriteRule for each site.
    No need for the RewriteBase directive, leave it commented out:

    #RewriteBase /drupal  DO NOT NEED THIS, COMMENT OUT
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/drupal/(.*)$
    RewriteRule ^(.*)$ /drupal/index.php?q=$1 [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/abc/(.*)$
    RewriteRule ^(.*)$ /abc/index.php?q=$1 [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/def/(.*)$
    RewriteRule ^(.*)$ /def/index.php?q=$1 [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/xyz/(.*)$
    RewriteRule ^(.*)$ /xyz/index.php?q=$1 [L,QSA]

    Note: each site has its own database aswell as files, modules and themes directories in the corresponding sites/localhost.site/ directory.

  • 相关阅读:
    hdu5249
    hdu5673-Robot
    hihoCoder 1033
    simpleOS 1.0
    hdu3511-Prison Break
    单调栈
    关于每次取PC的值为PC+4的问题
    hdu3652
    Linux MySQL5.7.18安装手册
    Linux MySQL5.6.36安装手册
  • 原文地址:https://www.cnblogs.com/eastson/p/3352572.html
Copyright © 2020-2023  润新知