htaccess redirect forbidden

I was truing to setup a redirect from a subdomain in my to another site. However, when I go tot he URL I receive a 403 access error You don’t have permission to access / on this server. Can anyone let me know what I did wrong?

Please paste the code you put in the .htaccess file or virtualhost config file here so we can take a look. It’s hard to say unles we are looking at it but my guess is that for some reason it thinks you are attempting to access the server root which of course apache would not have access to.

Here’s what I go so far:

Redirects (from site path to URL)

Redirect /home/site/siteone/code/testfeed

Can anyone advise?

Go to this site, all your answers for .htaccess

[quote=Adam;11486]Here’s what I go so far:

Redirects (from site path to URL)

Redirect /home/site/siteone/code/testfeed[/quote]

rone’s URL is a good one but offhand your problem seems to be that you have a full system path here. Try it with a path relative to the html directory of the site.

I found and corrected the location, however I still receive the You don’t have permission to access / on this server when going to the sub domain. Do I need to restart apache or something? How about permissions for the folder? Do they need to be set for global read write and execute?


You don’t need to restart Apache when making .htaccess changes, and you should not chmod 777 the directory. As long as the Apache user can read the directory (e.g., chmod 755), then it should be okay as far as permissions are concerned.

Look in /home/username/var/ and see if there are any more details in there.


also where is the .htaccess file? Is it in the site root or in the directory for the subdomain?

The .htaccess file is in the sub-domain. I checked the logs, and here is the error I received:

[SIZE=1]Directory index forbidden by rule:

That probably just means there’s no index.html file for it to display Adam. Could that be it?

edit posted that not having read the full thread… so that might be a dumb comment…


Nope, no index file, just the .htaccess file. Since it will be a feed, it needs to automatically redirect. .Htaccess was what I was told to to use, but for some reason, I do not know why it will not work.

Still not sure I fully understand the goal, but lets see if I can do a litte better. Assuming the .htaccess file is IN the subdomain folder, try this:

Redirect / http://the-other-site-you-want-to-redirect-to

That worked. Thanks Paul!