Forum Moderators: phranque

Message Too Old, No Replies

403 Forbidden message when trying to access website in subfolder

         

sisom

11:25 am on Jan 1, 2011 (gmt 0)

10+ Year Member



Hi, I have just set up a website in a subfolder of a domain, and changed the .htaccess file so that it points the new website's domain name to the subfolder, as follows:

# REWRITE FOR NEWSITE
ReWriteCond %{HTTP_HOST} newsite.co.uk
ReWriteCond %{REQUEST_URI} !newsite/
ReWriteRule ^(.*)$ newsite/$1 [L]


(That isn't the real domain name, in case you were wondering!)
The new site is in the folder:

[oldsite.co.uk...]

and the home page is called index.htm.

I can access the home page if I go directly to

[oldsite.co.uk...]

or
[newsite.co.uk...]

but if I go to
[oldsite.co.uk...]
or
[newsite.co.uk...]

I get the 403 Forbidden message.

I'm sure this is something simple that I've done wrong, but I've searched on Google and found a lot of different solutions, and wasn't sure which is best.

I am using a Fasthosts dedicated server, running Apache, and I am moderately proficient at using the command line (Fasthosts has an excellent remote control console which lets you control the server as if you were looking at its screen and typing on its keyboard).

Many thanks in advance for any help you can give.

jdMorgan

6:26 pm on Jan 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there an index file in /newsite? If not, you'll need to define one.

If there is one, then the likely problem is that its filetype is not defined in the standard server configuration's list of possible index page types. You will need to add
 DirectoryIndex <index filename>.<index filetype> 


for example,
 DirectoryIndex homepage.cgi 

to your .htaccess file, either in /.htaccess or in /newdomain/.htaccess

Jim