GoDaddy shared hosting allows multiple domains hosting where each domain can be hosted within its own folder in the document root. I install Drupal in a separate folder for each domain, even for the main domain. GoDaddy supports URL redirect and each domain can be redirected to its on folder. However, Drupal may get confused with the RewriteBase for clean URL rewriting.
Drupal handles URL rewriting for clean URL automatically. In fact, Drupal will try to enable it by default. On the other hand, there is no issue with GoDaddy regarding the Drupal URL rewriting. However, Drupal need to know the RewriteBase when a domain is NOT pointing to the document root folder. The RewriteBase is not necessarily the Drupal installation folder. This can be tricky because GoDaddy URL redirect may be set in two places.
In GoDaddy a domain can be redirected to a folder, even for the main domain. A http://xyz.com can be redirected to http://xyz.com/xyz which is my preferred configuration. The /xyz is a folder in my document root folder, which is now the root folder for http://xyz.com. Thus, my Drupal RewriteBase must be /.
The Drupal RewriteBase is set in .htaccess file in the Drupal installation folder somewhere near to the following line:
# If your site is running in a VirtualDocumentRoot at http://example.com/ ,
# uncomment the following line:
RewriteBase /
Also in GoDaddy, any URL can be redirected to any other URL. If Drupal is installed in a sub-folder of a domain which is already in a folder of its own such as http://abc.com/abc/jkl then I need to deal with three things:
GoDaddy URL redirect will alter the .htaccess file in the document root.
Drupal handles URL rewriting for clean URL automatically. In fact, Drupal will try to enable it by default. On the other hand, there is no issue with GoDaddy regarding the Drupal URL rewriting. However, Drupal need to know the RewriteBase when a domain is NOT pointing to the document root folder. The RewriteBase is not necessarily the Drupal installation folder. This can be tricky because GoDaddy URL redirect may be set in two places.
In GoDaddy a domain can be redirected to a folder, even for the main domain. A http://xyz.com can be redirected to http://xyz.com/xyz which is my preferred configuration. The /xyz is a folder in my document root folder, which is now the root folder for http://xyz.com. Thus, my Drupal RewriteBase must be /.
The Drupal RewriteBase is set in .htaccess file in the Drupal installation folder somewhere near to the following line:
# If your site is running in a VirtualDocumentRoot at http://example.com/ ,
# uncomment the following line:
RewriteBase /
Also in GoDaddy, any URL can be redirected to any other URL. If Drupal is installed in a sub-folder of a domain which is already in a folder of its own such as http://abc.com/abc/jkl then I need to deal with three things:
- Redirect domain abc.com to folder /abc in the GoDaddy hosted domain settings.
- Redirect http://abc.com/jkl to http://abc.com/abc/jkl in URL redirect settings.
- Set RewriteBase to /jkl in the Drupal .htaccess file.
GoDaddy URL redirect will alter the .htaccess file in the document root.
Comments
Post a Comment