duncmorley
Member
Posted 11 months ago #
Hi there
I have recently moved my wordpress blog to and all-in-one wordpress website. On my old blog the URL's were set up like this:
blog.domain.co.uk/2001/06/post-title
Now on my new site the root of the blog is:
http://www.domain.co.uk/blog/
and the articles are:
http://www.domain.co.uk/2011/06/post-name
I am looking for some help with my .htaccess file so that all traffic going to blog.domain.co.uk will go to the root of my blog (www.domain.co.uk/blog/) and everything else is just the domain changing from blog.domain.co.uk to the http://www.domain.co.uk.
Hope this makes sense
Thanks in advanced for any help with this.
Duncan
I would suggest making the root /blog and the articles /blog/2011.... because otherwise that gets messy. OR the root should be / (no blog).
Put this ABOVE the WordPress section.
RewriteCond %{HTTP_HOST} ^blog\.domain\.co\.uk
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=301,L]
That should send everything
duncmorley
Member
Posted 11 months ago #
I would love to make everything http://www.domain.co.uk/blog/2011... but could not find out how to do that. Changing the permalink to /blog/%category% was not an option.
How did you make the main blog http://www.domain.co.uk/blog/ then?
duncmorley
Member
Posted 11 months ago #
Created a page called "blog" and linked the post page to that.
So you did this: http://codex.wordpress.org/Creating_a_Static_Front_Page
Okay. What happens when you change the permalinks to /blog/%year%/%month%/%postname%
duncmorley
Member
Posted 11 months ago #
That works fine for the actual posts but then mucks with my custom post types.
Well, this will redirect blog.domain.co.uk/whatever to domain.co.uk/whatever ... so that should cover most of it.
RewriteCond %{HTTP_HOST} ^blog\.domain\.co\.uk
RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=301,L]
blog.domain.co.uk itself will go to domain.co.uk sadly.