.htaccess URL redirect problems completely solved

Continuing on my .htaccess requirements from my previous post, I have finally completely solved it.

# BEGIN WordPress

RewriteEngine On
RewriteCond %{HTTP_HOST} !^tombammann\.homedns\.org
RewriteRule (.*) http://tombammann.org/$1 [R=301,L]

The above two lines converts any subdomain, i.e. http://www.tombammann.org or http://wwwwwasdfasdf.tombammann.org into http://tombammann.org.

RewriteRule ^journal/(.+)?$ http://tombammann.org/$1 [QSA,L]
Redirect /journal http://tombammann.org

The above two lines are used because I used to have wordpress installed to http://tombammann.org/journal, so basically these two lines deletes the /journal without chopping off any of the rest of the URL.

RewriteRule ^software-i-use /category/computing [R=301,L]

And here this line converts any url containing the string of text software-i-use to the new /category/computing category of my wordpress blog. (Previously my computing page was a static page).

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

# END WordPress

So happy I’ve got that all working now :D

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>