cancel
Showing results for 
Search instead for 
Did you mean: 

htaccess to forward domain name to a folder results in 500 Internal Server Error

mouseblack
Dabbler
Posts: 17
Thanks: 1
Registered: ‎17-03-2008

htaccess to forward domain name to a folder results in 500 Internal Server Error

I'm OK with basic htaccess... and my setup has been working for about a year since I first created it.
I have a folder on the CGI server that contains HTML files only (no php). I have an .htaccess file in the root directory that forwards two domain names to the folder in question and one other folder on the CGI server (the other folder contains a Wordpress installation). As I said this arrangement has been working for about a year.
The other day I decided to temporarily upload Worpress into the folder that has just HTML files. Trying to be clever I renamed the Wordpress index.php file to index1.php as I have an index.html file the folder and decided to implement the Worpress installation navigating to the index1.php - it worked.
I can't remember exactly when I got the 500 Internal Server Error but I renamed the index.html to index1.html and the Wordpress index1.php to index.php.
Anyway I started to get the Server Error so I deleted the Wordpress files and changed the index1.html  back to index.html.
I still got the error.
I contacted Plusnet - they don't seem to have any idea. On their suggestion I deleted the .htaccess file in the root directory and the folder in question with content and then re-uploaded these files. Still got the error.
Plusnet can't seem to help me and directed me to the Community Forum.
I am able to edit the .htaccess to point to another folder and it works but with some other folders it doesn't.
If I navigate directly to the folder in question e.g. ccgi.myusername.force9.co.uk/folder instead of www.mydomainname.co.uk it works!
I have even created a new folder and uploaded the content and edited the .htaccess acordingly and I still get the error.
Throughout all of this the other domain name that is directed to it's folder has continued to work.
Any ideas? Am I missing something really obvious?
Oh I'm on the Plusnet CGI and not PAYH.
Thanks
3 REPLIES 3
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: htaccess to forward domain name to a folder results in 500 Internal Server Error

I've had a quick look at this on my lunch break, hope you don't mind.
The rewrite rules were resulting in an infinite loop, so I added in another condition to not redirect if it has already been redirected. Not sure if this fixes your original problem but the server errors have now gone.
mouseblack
Dabbler
Posts: 17
Thanks: 1
Registered: ‎17-03-2008

Re: htaccess to forward domain name to a folder results in 500 Internal Server Error

Fantastic - Thanks Ben !
Interestingly the code you put in is what I originally had - I was following the instructions at http://community.plus.net/forum/index.php/topic,46224.0.html.
But as you can see somewhere in the thread someone suggested that the 'RewriteCond %{REQUEST_URI} !^/foldername/' wasn't required - and indeed it wasn't until now !
Thanks again
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: htaccess to forward domain name to a folder results in 500 Internal Server Error

That's weird, I can't see how it would ever work without it. I'll see if anything has been changed recently on CCGI here which might have caused it to stop working.