Posts Tagged “rewritecond”

Well I have been having issues with the permalinks and Wordpress being in the Root Directory.  Before stuff would redirect to my 404 page and say if I had a password protected directory it would also redirect to my 404 page.  Recently I have fixed that I would like to share this.

Now what I done is made a onerror.html and there don’t have to be any content or any code, just the blank page called “onerror” and the file extension “.html”  And then you have to add this to the “.htaccess” file in your root directory, which is just these two lines of code
ErrorDocument 401 /onerror.html
ErrorDocument 403 /onerror.html

Now what this does is allow password protected directory’s to be used.  And also when you type in a directory in the address bar that doesn’t exist on the web host it will not redirect to your homepage. How ever I am still working on a few problems of my own.  Like when I type in “nerwin.net/gallery” it works, but say if I click on an album, it just directs to my homepage, which I really hate! and this is part of Wordpress being in the Root Directory! and once I solve this, I will post a Part two to Wordpress in root Directory.

Below is what your (or close) .htaccess file looks like inside which the code I told you to add

ErrorDocument 401 /onerror.html
ErrorDocument 403 /onerror.html
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

I Truly know that this method works, I’m sure there is others but this is a good easy way that works.

I hope this has helped a little!

Tags: , , , , , , , , , ,

Comments 2 Comments »

© 2009
Login