-->
Searching...
Friday, April 20, 2012

Wordpress 301 redirect and permalinks

Take away the blogs and the World Wide Web is a desert! - Anynomous
For a week I've been migrating some stuff from an old website written with php and html to Wordpress. However I don't want to lose all the traffic therefore, while setting up the new site, I redirected all the old page to the new site through 301 redirect in the htaccess file.

However I found I that if I change the wordpress permalinks structure then all my 301 redirect wouldn't work and the page will show '404 page not found' error. After much agonising and reading through, trying plug-ins and what not. Finally I resolved the issue with a simple trick. The trick is to just put all my redirect link on TOP of this code  instead of writing the redirect link below it.


# BEGIN WordPressRewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]
# END WordPress


I've been writing by redirect code using Cpanel redirect tool, so I didn't realize that it writes code below the #Wordpress call code. After examining the htaccess directly and reading some advice giving by Wordpress expert out there. I put the code below my redirect code, and changing my permalink lo and behold, my redirect access goes to the right page.

So simple and it works. I can the site permalinks without having to see the 404 error.

--Update--
Okay after working out the permalinks problem I had another problem, my web is a 2 part directory, the main page is under Wordpress and there is another directory holding all my e-store page under Oscommerce.

I found out that if I change Wordpress permalinks, I cannot access my Oscommerce admin directory from the usual link I had, it became '404 page not found eror'.

After reading on the net and trying some of the solution, I finally found one that works.

I just access the .htaccess file for my Oscommerce and insert this line in it

ErrorDocument 401 "Unauthorized"

For now this is my solution for my wordpress permalinks problem which intefere with my Oscommerce admin directory.

If this doesn't work for you maybe you can visit this page to find other solution: http://wordpress.org/support/topic/subdirectory-woes

WordPress is a ‘community’ of lovers!

0 comments:

 
Back to top!