CorNinaber.nl

Redirection to wordpress directory

Finally got around to setting up my site. I figured doing it in WordPress because I thought it would be relatively easy to create something nice. Well it did, after a quick install I was up and running.

The only thing I was stuck with, was the subdirectory that was used for the wordpress install and

it showing up in the URL. A (easy) solution would be to install WP in the document root, but I like having the files in a separate directory, so on with the search. The control panel of the site did provide the option to specify some redirects, which sort of fixed it, because the main url did redirect to the wordpress site, but it also still showed up in the url (corninaber.nl/wp). Almost, but still not totally…
Was guessing it could be something in the .htaccess and found links referring to editing it to obtain the effect. Then I came across http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory, which exactly described the thing I wanted (don’t know why I didn’t read this one before..).

It is a fairly easy process;

  1. Specify the root directory in the general panel of wordpress (so no delete the /wp)
  2. Copy the .htaccess and index.php files from the wp directory to root (back-up the ones already existing, just to be save)
  3. Edit the new index.php file so that the require points to the right place; require(‘./wp-blog-header.php’) -> require(‘./wordpress/wp-blog-header.php’)
  4. (Possible update the permalinks if these are present)

That’s all, just the way I wanted it; A clean looking (and valid) url and a tidy subdirectory install.

Next Post

Previous Post

Leave a Reply

© 2024 CorNinaber.nl

Theme by Anders Norén