WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess Moving /blog/ To / (2 posts)

  1. steffan
    Member
    Posted 7 years ago #

    Right then! I've decided to move my wordpress install from domain.co.uk/blog/ to domain.co.uk.

    Basically, I still want people to be able to access anything that used to be at /blog/, for example I still want people to be able to go to /blog/category/postname; I just need that to point to /category/postname. I also want /blog/ to point to /.

    I've looked for help and I've tried searching a lot of posts, however I'm a bit of an idiot.

    Any help would be much appreciated!

    Thank you.

  2. AskApache
    Member
    Posted 7 years ago #

    This should replace your current wordpress area of your .htaccess file. Note that your old RewriteBase was /blog/

    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^blog(.+) http://domain.co.uk$1 [R=301,L,NC,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    See Also: htaccess article

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags