Computers

Archived posts from this Category

Wordpress Permalink Problem

Posted by Mark Lawton on 31 Aug 2009 | Tagged as: Computers, Wordpress, blogging

Hi Folks,

I don’t know about you, but I had a terrible time sorting my permalinks out on Wordpress.

The defaults are ugly, so I changed to the “proper URL” look.

I accessed my host, changed the permissions on the .htaccess file, edited it manually, and so on. I could not get the links to work.

Anyway I finally found the problem DOH!

The links do work, but because Wordpress is installed in a sub directory i.e” /marklaw1″ this path has to be included in the .htaccess file.

The path was inserted, and bingo! Job done.

I’ll show you…

The .htaccess contents before it worked…

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

Now all I added was “/marklaw1″ as below…

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

Job done, permalinks now work!

Now whatever they I change them to now it works every time, but for the sake of SEO I’ll leave them as they are now.

Phew!

Have a look here and this guy knows his stuff…

http://perishablepress.com/press/2006/06/14/the-htaccess-rules-for-all-wordpress-permalinks/

Be sure to get backups of every file you modify, or you can get in a mess!

Be careful, and have fun.

Also look here for general guidance…

http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F

Another problem was that everything now worked except for my home page,!

This read-up may be the answer to this problem…

http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

In brief, go to settings, and change your blog address, inĀ  my case from www.mark-lawton.com, to www.mark-lawton.com/marklaw1/ – job done, permalinks working, and latest post displayed on my home page!

Let’s hope it is worth it to gain extra SEO, and hopefully drive “millions” of people to my website (dream on!)

Mark