Giving Wordpress it´s own directory

Psst! In swedish after the “read more” link / Psst! På svenska efter “läs mer” länken!

I’ve been getting som questions about how to have your WP-install in a subfolder but without the /wordpress-suffix on your domain, mainly by people that have used some sort of auto-installer to set up their blog.

This often results in a situation where you already have a subdirectory and the blogadress is set to www.domainname.com/wordpress or corresponding. The instructions in the WP codex presumes that you are moving your WP files, sometimes making it a bit confusing for beginners to understand them.

Changing this acually isn’t that difficult, so here it goes:

First; some need-to-knows:
1. Use some kind of ftp-program to access the files.
2. To save yourself from headache – do not change any settings in the WP admin area under Settings/General until the very last step! ;)
3. The original index.php-file in /public_html/wordpress/ is to remain unaltered, you only need to copy it!
3. The root folder is commonly named “public_html” but not always. If unsure – ask your web host.
4. These instructions presumes that the folder where your Wordpress files are located is called “wordpress”, that your domain name is “yourbloghere.com” and that your root folder is called “public_html”.

Let’s get to work!

1. Go to /public_html/wordpress/ and download the file called index.php.

2. Open index.php in for example Notepad and find where it says require(‘./wp-blog-header.php’);

3. Change this into require(‘./wordpress/wp-blog-header.php’); and save the file.

4. Make sure you don’t have any files named index.html, index.php or anything like that in /public_html/. (If you do – rename them to for example index_old.)

5. Upload your altered index.php here. (Not in /public_html/wordpress/!)

6. Make sure everything is correct and that the “index.php” in /public_html/wordpress/ looks the same way it did when you started.

7. Now go to the admin area of your blog, Settings -> General and change “Blog address (URL)” to “http://yourbloghere.com”. (The “WordPress address (URL)” should be “http://yourbloghere.com/wordpress”)

8. Voilá – your done! Surf to http://yourbloghere.com/ and take a look! =)

Och så på svenska:

1. Gå till /public_html/wordpress/ och ladda ner filen som heter index.php.

2. Öppna index.php i exempelvis Anteckningar och hitta där det står require ( ‘./wp-blog-header.php’);

3. Ändra detta till require ( ‘./wordpress/wp-blog-header.php’); och spara filen.

4. Kontrollera att du inte har några filer som heter index.html, index.php eller liknande i /public_html/.  (Om du har det – döp om dem till exempelvis index_old.)

5. Ladda upp din modifierade index.php till /public_html/ . (Inte till /public_html/wordpress/!)

6. Kontrollera att allt är korrekt och att “index.php” i /public_html/wordpress/ ser på samma sätt som den gjorde när du började.

7. Nu loggar du in till admin, går till Inställningar -> Allmänt och ändrar “Bloggadress (URL)” till “http://yourbloghere.com”. (I “WordPressadress (URL)” ska det stå “http://yourbloghere.com/wordpress”)

8. Voilá! Surfa in på din blogg och ta en titt! =)

  • TwitThis
  • Facebook
  • Bloggy
  • Pusha
  • Digg
  • del.icio.us
  • StumbleUpon

"Giving Wordpress it´s own directory" has 2 Comments:

Drop a comment

Required fields are marked with *.
Your email-adress will not be shown publicly.