How to remove /drupal from URL in Drupal 7 when installation is in the associated sub-directory

前端 未结 3 1553
感动是毒
感动是毒 2021-02-10 18:47

In Drupal 6 I was able to successful install Drupal in a subdirectory called drupal and then reference the site without having to use example.com/drupal. In Drupal 6 to get this

3条回答
  •  感动是毒
    2021-02-10 19:39

    I answered a very similar question on this here: Two Drupal installation on the same server My answer to your question is the same, I recommend eschewing the rewrite method in favor of the virtual host method as described below (which is just an excerpt of what I answered in the link above):

    ... To do this correctly you must first enter the following line (or un-comment the line if >it already exists):

    NameVirtualHost *:80
    

    Next you must create the two virtual host entries. One will be similar to the following:

    
    ServerName your.url.fortheroot
    ServerAlias alternate.url.fortheroot
    DocumentRoot "/path/to/webroot"
    
    

    The next entry would be similar to the following

    
    ServerName your.url.forthesubfoldertest
    ServerAlias alternate.url.forthesubfolder
    DocumentRoot "/path/to/webroot/test"
    
    

    ...

    In your case, however, you would only require one virtual host entry & not two.

    Additionally, it should be noted that, should you desire to serve a site from a location NOT in your webroot then you would also need a

    
    

    entry to tell Apache what access to give to visitors (NOTE: in Linux the Apache user should be made owner of the files [or permissions should be set in a method that still allows the apache user rights to serve the files if you want to avoid giving it ownership])

提交回复
热议问题