I have a website on GoDaddy. I have WordPress downloaded on a directory called blog.

I would like so that when some one types my website name it takes it to the blog, but at the moment I have to type /blog at the end of it.

Is what I want possible, if so how do I do it?

  • What is the web server?? Apache, IIS, Nginx? It makes a difference in how to answer this question. Of course, you could just remove WP and reinstall it to work in the root directory. That would be what I would do. It would be a lot cleaner in the end. – closetnoc Jul 27 '15 at 4:38
  • I know its a linux server. I have considered a reinstall. main reason is that I like to stay organized and would like to have blog aspect of my website in folder. Also i will continue to look into the server but not really sure where to look for that – Burb Jul 27 '15 at 5:11
  • It is okay to have it in a blog directory. I would then just create a website rather than redirecting... however, a redirect would be wise for the short term. If you have Apache, you would see the directory /etc/apache2/ which is where it is typically installed, though some packages install it in other places. – closetnoc Jul 27 '15 at 5:21

You can either move it from the directory as mentioned, or you can keep it in the directory and have it appear in the root by doing a bit of tweaking as follows:

  1. Go to the General panel.

  2. In the box for Site address (URL): change the address to the root directory's URL. Example: http://example.com.

  3. Click Save Changes. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)

  4. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site—the latter is probably named something like www or public_html. The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file. If you are running WordPress on a Windows (IIS) server and are using pretty permalinks, you'll have a web.config rather than a .htaccess file in your WordPress directory.

  5. Edit your root directory's index.php.

    1. Open your root directory's index.php file in a text editor
    2. Change the line that says: require( dirname( __FILE__ ) . '/wp-blog-header.php' ); to the following, using your directory name for the WordPress core files: require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );
  6. Save the file.

  7. Login to your site (if you aren't still already). The URL should still be http://example.com/wordpress/wp-admin/

  8. If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can't write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

More info here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.