Forum Moderators: phranque

Message Too Old, No Replies

Strange issues with .htaccess - only 1 line works?

My file worked before... now it doesn't.

         

raeanne

6:28 pm on Apr 17, 2008 (gmt 0)

10+ Year Member



Hello,

I'm new to Webmaster World, so first off, thanks in advance for any assistance!I'm primarily a designer, so dealing with server issues is new for me - but I'm experiencing a strange issue that's had me pulling my hair out for days now.

I use GoDaddy shared Linux hosting, which could be part of my problem, but until yesterday had not experienced any issues previously. I use the same hosting service for both my personal sites and the hosting services we offer at my day job.

Yesterday I completed a hosting move that involved taking an HTML site that had PHP includes (the previous host was set to parse PHP) and moving it to our hosting. I changed all the pages to .php because I was told GoDaddy would not support parsing. In an attempt to prevent broken links and keep search engine rankings, I made an .htaccess file with 301 redirects.

A few things to note: I've done this before for my own site when I changed from Windows to Linux and had to redirect all old .ASP pages to the new .PHP - and everything worked fine.

I actually copied and pasted code from my already-working .htaccess file to ensure that my syntax was correct.

However, every time I upload the file I get a 500 Internal Server Error. Oddly enough, though, when I write only one line of redirects, it works! As soon as I space down and list another redirect, I get the error. I've tried every imaginable way of writing it (variations with redirect 301, redirect, Redirect, redirect permanent, redirectpermenent) all with no luck.

Even more strange, is that I tried to edit the .htaccess file from my site that was already working and got an error there, too. I reverted to my old .htaccess and AGAIN got the error. I've since been forced to remove my .htaccess from my personal site that was working fine because now it doesn't work at all.

I am completely baffled by what's going on here. I submitted a ticket to GoDaddy to find out if something has changed on their end that would cause this and they've assured me that they've done nothing.

Anyone that can help me figure this out? I will be super grateful for any input.

Just one other note: I'm operating on a Mac and edit my .htaccess file with Dreamweaver, in case that has any relevance.

Cheers and thank you!

jdMorgan

6:47 pm on Apr 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do not use Dreamweaver to edit .htaccess, or anything else except Web pages -- Use Textpad or whatever plain-text editor you have on your Mac.

Without seeing some example code and the relevant data from your server error log, it's a bit difficult to offer anything more than that general advice. However, if the code works on other servers, then it's somewhat likely that you've got a character-encoding problem as a result of trying to use Dreamweaver.

Jim

raeanne

7:30 pm on Apr 17, 2008 (gmt 0)

10+ Year Member



Thank you so much! I wondered if that was the problem but I wasn't sure how to diagnose...

I just created a new file in TextEdit, made sure the character encoding was ASCII, and it's working!

Thank you thank you thank you :)

g1smd

1:40 am on Apr 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




*** I changed all the pages to .php because I was told GoDaddy would not support parsing. In an attempt to prevent broken links and keep search engine rankings, I made an .htaccess file with 301 redirects. ***

You do not need a redirect to fix this. You should use a rewrite. You can then keep the old .html URLs intact, indexed, and ranking, while actually using .php files on the server.

raeanne

1:06 pm on Apr 18, 2008 (gmt 0)

10+ Year Member



g1smd: I didn't realize that - thanks for the tip! As I said in my first post, I am very new to this stuff, so I was unaware of any other solutions.

Cheers,
Raeanne

g1smd

10:45 pm on Apr 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's also the easiest solution to implement, because you don't change any of the links on the pages of your site.