Apache Mod Rewrite - ENTIRE SITE GONE!

Found a bug? Tell us!!
Post Reply
roamingk
Regular
Posts: 9
Joined: Sat Oct 07, 2006 2:17 pm

Apache Mod Rewrite - ENTIRE SITE GONE!

Post by roamingk »

Please can someone help me

my site http://www.gaysitgesguide.com/serendipity suddenly disappeared... I was going through the settings and clicked on the setting, regarding making urls search engine friendly". The setting was not activated... so I activated it choosing Apached Mod ReWrite.

Now I get a 404 error when I get to the home page and to when I try the login page....

3 months daily postings have also disappeared...

Can anyone help?
roamingk
Regular
Posts: 9
Joined: Sat Oct 07, 2006 2:17 pm

update

Post by roamingk »

Just a clarification,.its a 500 server error I get... all of the HTML pages seem to be missing from the archive page... as does the feeds directory... however.... all of the entries are saved in the SQL table...

now i just need to know how to fix the error and restore the blog...

anyone got any ideas please?
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

Download a copy of your .htaccess via FTP (If you don't see your .htaccess file, enable server side filtering with the command -a) and delete this:

RewriteEngine On
RewriteBase /
RewriteRule ^(archives/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.html) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^comments/(.*) index.php?url=/comments/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]

Save and you should be able to login.

Or if you wanna do it an easier way, save this as .htaccess and upload it to your root serendipity directory:

# BEGIN s9y
DirectoryIndex /index.php

<Files *.tpl.php>
deny from all
</Files>

<Files *.tpl>
deny from all
</Files>

<Files *.sql>
deny from all
</Files>

<Files *.inc.php>
deny from all
</Files>

<Files *.db>
deny from all
</Files>

# END s9y
roamingk
Regular
Posts: 9
Joined: Sat Oct 07, 2006 2:17 pm

Thanks..... one more step?

Post by roamingk »

Hi.

I changed the HT Access just by rewriting what you told me. Thanks for that ... I can now access the admin panel. The index page is still not visible. Is there any easy way to automatically restore the posts that are in the sql database or do I have to manually reenter them all?

Once again thanks for your help.

K
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

You may also have to change your configuration to show "Disable rewrite" before the posts will show.

Oh and I forgot to mention, in your .htaccess, delete the line ErrorDocument 404 /index.php
Last edited by azel on Sat Oct 07, 2006 6:15 pm, edited 1 time in total.
roamingk
Regular
Posts: 9
Joined: Sat Oct 07, 2006 2:17 pm

Thanks!!! It Worked

Post by roamingk »

Thanks That worked....

I will never ever ever touch that button again!

If you are ever in Sitges... a lot of drinks are on me!

Thanks again :D
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

Thanks! Your blog is pretty spiffy. :)
Post Reply