htaccess file troubles...

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
rj
Regular
Posts: 477
Joined: Sun Sep 10, 2006 2:53 pm

htaccess file troubles...

Post by rj »

Around last September I moved Serendipity out of /serendipty into the root. By doing so I got my Google Page Rank of 5 back, Being in a sub directory had reduced it to a PR 3.

After the move there was some confusion regarding the .htaccess file that I never resolved.
It came to pass that I could no longer include an .htm file in the root without the link defaulting to index.php.

When I installed the new version of serendipity last week for a new blog, funebrity.com I tested it to see if I could put a .htm in the root and had no problem there.

So I took the new .htaccess file (that was very plan) and uploaded it to the old blog rackjite.com. It stalled for a while and then loaded. I put a .htm file in the root and it loaded fine too.

But with the new .htaccess file none of the serendipity links work, I get a 404 or a 403...

I would really like to resolve this issue as I have 25 big html pages of original content (about 200,000 words) that moving to the root would knock their google page rank up one or 2 as they were a year ago when it was a webpage rather than a blog.

Below is a paste of last September's .htaccess file which I am presently using. Can something be done in this file to solve this? If not are there other options? Upgrade? Re install?

The files I want to move to the root are in /web.
I have one htm file in the root now which goes to index.php instead.
http://rackjite.com/talking_points.htm
Also I do not use FRONTPAGE anymore so I dont know what that stuff down at the bottom is either... :)

Thanx

RJ


---------------htaccess--------------
Options +FollowSymLinks
Options +Includes
AddHandler server-parsed .htm

#www rewrite
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^rackjite\.com
RewriteRule (.*) http://rackjite.com/$1 [R=301,L]

#website 301
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^http://rackjite.com/
#RewriteRule ^(.*)$ http://rackjite.com/web/$1 [L,R=301]

#Redirect 301 http://rackjite.com/ http://rackjite.com/web/

#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^http://rackjite.com/serendipity [NC]
#RewriteRule (.*) http://rackjite.com/$1 [L,R=301]

#Redirect 301 http://rackjite.com/serendipity/ http://rackjite.com/

#ErrorDocument 404 /serendipity/index.php
#ErrorDocument 404 /index.php
#DirectoryIndex /serendipity/index.php
DirectoryIndex /index.php

RewriteEngine On
#RewriteBase /serendipity/

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 ^(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]

<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

#FrontPage

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.rackjite.com
AuthUserFile /var/chroot/home/content/r/a/c/rackjite/html/_vti_pvt/service.pwd
AuthGroupFile /var/chroot/home/content/r/a/c/rackjite/html/_vti_pvt/service.grp
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I believe your problem is your last RewriteRule:

Code: Select all

RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
An Initiate in the Mysteries of the Regular Expression would see that this will match anything ending in .html or .htm.

If you remove the question mark at the end of the .html, it'll only match stuff ending in .html.
Judebert
---
Website | Wishlist | PayPal
rj
Regular
Posts: 477
Joined: Sun Sep 10, 2006 2:53 pm

Post by rj »

YOU THE MAN!!!!!!!!!!

RJ

took me 8 months to get that fixed... :)
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Glad it worked out for you!

You might want to make sure that none of your custom permalinks end in .htm, since Serendipity won't be redirecting that any more.
Judebert
---
Website | Wishlist | PayPal
Post Reply