Help! Webhost chews up my htaccess

Status
Not open for further replies.

silverpig

Lifer
Jul 29, 2001
27,703
12
81
I run a little blog and yesterday I got a 500 error. I checked the logs and found an error relating to my .htaccess file. I downloaded it and it was all messed up, despite me not having done anything to it and it working perfectly fine for months. Having a backup, I just uploaded a new one over top and everything was back to normal.

Now I wake up this morning and I got the same error. Sure enough, messed up .htaccess file and my site was down all night long. What could be chewing up my .htaccess file?

It looks like someone took the original, chopped off a few lines, then randomly copied and pasted parts of the rest into the rest of the file:

Good Version
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !blog/
RewriteCond %{REQUEST_URI} !phpBB2/
RewriteCond %{REQUEST_URI} !images/
RewriteRule (.*) http://www.wifitalk.ca/blog/$1 [l]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

What was there this morning
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
d_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I'm not exactly sure what section to post this in, so mods move it if there is something appropriate.

Gah: it JUST happened again. 3 minutes after I loaded the last file.
 

silverpig

Lifer
Jul 29, 2001
27,703
12
81
Is wordpress doing it? You could ask your host about it.

That's part of the problem. My hosting company sucks. The site's constantly down. I asked about it yesterday and the tech just said there was a problem and gave me no more information.

I've made the file read-only so we'll see if that helps.
 

manlymatt83

Lifer
Oct 14, 2005
10,051
44
91
Looks like wordpress's attempt to "self install" itself.

Try doing "chmod 444" and see if that stops good ol' wordpress from overwriting it. Vivi's suggestion might work too, but if it's a host that's running an apache instance as you, it won't.
 

dartworth

Lifer
Jul 29, 2001
15,200
10
81
Squarespace is all you need. Just import wordpress into it.

If you choose to use wordpress, use hostgator

/thread
 
Status
Not open for further replies.