Hi, I have a question about redirecting Drupal when it's installed in the sub-directory of an add-on domain. I looked around the forum and searched on Google, but can't seem to find a thread that is related to this situation (most of them are on multi-sites or redirecting from sub-dir to root), I'm sorry if this has been previously discussed, in which case please do point me to the correct place ^^;
Anyways, I have Drupal installed in the sub-directory of an add-on domain, so the directory structure looks like this:
public_html/addon.com/drupal/
While to users the site would appear as follows:
addon.com/drupal/
Since CPanel treats the add-on domain as a subdomain, sometimes Google is indexing the site as a subdomain like this:
addon.site.com/drupal/
(instead of addon.com/drupal/
)
I tried doing a redirect in .htaccess with the following:
RewriteCond %{HTTP_HOST} ^addon.site.com/drupal
RewriteRule ^(.*)$ http://www.addon.com/drupal/$1 [R=301,L]
But the redirect is not working.
I tried changing base_url in setting.php to "addon.com/drupal", and uncommenting the line "RewriteBase /drupal" in .htaccess (note I also uncommented the part in .htaccess that allows users to access the site with the 'www.' prefix), but that didn't help either.