Redirect browser to a sub directory with WordPress

Redirect browser to a sub directory with WordPress

My blog is running with WordPress in the sub directory blog of my domain. If you, as a visitor, forget to enter /blog, this little index.php file in my root directory will redirect your browser to the sub directory.

You’ll need a sitefunction.php file with this content as well. The status code can be adjusted to your needs.

Unfortunately I don’t remember where I got this idea from 🙁

Leave a Reply