.htaccess - addon domains

Merlin

Expert Member
Joined
Jan 18, 2006
Messages
2,789
Reaction score
320
Location
Cape Town, South Africa
Hi all,

So I sorted out the first query I had, but I've come across a new one...

I have an addon domain registered to my hosting account.

I have an .htaccess sitting in the root which controls 'a lot of stuff'.

Now I want to place an .htaccess in the folder which houses the addon domain.

/.htaccess
/addon/.htaccess

As soon as I put an .htaccess into the addon folder - regardless of what it is in the file - the 'site fails with a 500 error.

Any ideas why this would be?

Here is the code I'm trying to get working:

Code:
################################################## Rewrite Manipulation
# Engine
RewriteEngine on
Options +FollowSymLinks

# No 'www' to 'www'
RewriteCond %{HTTP_HOST} ^exquisiteinteriors\.co.za$ [NC]
RewriteRule ^(.*) http://www.exquisiteinteriors.co.za/$1 [R=301,L]

# 'www' subdomain to root
#RewriteCond %{HTTP_HOST} ^www.exquisiteinteriors.the3rdrock.com$
#RewriteRule (.*) http://www.exquisiteinteriors.co.za/$1 [R=301,L]

# No 'www' subdomain to root
#RewriteCond %{HTTP_HOST} ^exquisiteinteriors.the3rdrock.com$
#RewriteRule (.*) http://www.exquisiteinteriors.co.za/$1 [R=301,L]

# Host folder redirect
#RewriteCond %{HTTP_HOST} ^(www\.)?the3rdrock.com/exquisiteinteriors/$ 
#RewriteRule (.*) http://www.exquisiteinteriors.co.za/$1 [R=301,L]

Thanks, Nic
 
Hey RS,

Thanks for the reply.

I also found that suggestion via Google but it's to no avail.

Even a blank .htaccess triggers a 500 error.

It must be something in my root .htaccess that I haven't found yet (it's a big file).

Thanks, Nic
 
you need followsymlinks on if you're going to be doing rewriting...
500 errors... what a mission.
you may pick something up if you set the log level to debug.
otherwise... cut, test, paste.
it's not a permissions issue on the subdirectory hta perhaps?
 
Are you absolutely certain you are editing in plaintext and the file does not have any metacharacters that are used by the text editor?
 
Turn off Friendly HTTP Errors n00b :p

No but seriously, addon domains are usually configured at server level AFAIK, and "addon domains" are just aliased domains linked to your primary... so essentially whatever .htaccess you have on your primary will look/act the same in your aliased domain unless you have specific URL code in there for some reason
 
*lol* Hi guys,

Firstly, I've learnt a lot from tinkering with this stuff, but I'm certainly not an expert. ;)

That said, how do I set the log level and where would I view these logs? Cpanel?

hta? ...as in password protected dirs? I've got not security set on my domain.

I am editing this .htaccess file exactly the same as my root .htaccess - in Notepad.

*lol* @ AR. How? :D

Are you suggesting I put these instructions into the root .htaccess?

Also, it may or may not be related but I cannot get subfolders to NOT redirect from the root. Could it be the cause of the problem in the subfolder .htaccess?

An example of what I've been trying (some excess and unrelated code has been removed):

Code:
RewriteEngine on
Options +FollowSymLinks
RewriteBase /

# Add trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ /$0/ [L,R=301]

# No 'www'
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Root redirect exclusions
# Domain exclusions
RewriteCond %{HTTP_HOST} ^(www\.)?exquisiteinteriors.co.za$
[color="#ff0000"]RewriteCond %{REQUEST_URI} !^/(exquisiteinteriors|blog).*$[/color]
RewriteRule .* - [S=3]

# Page exclusions
RewriteCond $1 !^phpinfo\.php$
RewriteCond $1 !^robots\.txt$

# Root redirect
RewriteRule (.*) http://the3rdrock.com/mongolrally/$1 [R,L]
 
Top
Sign up to the MyBroadband newsletter
X