3

I have recently been re-designed a client's website (whose website is - for example purposes - mywebsite.co.uk)/

I have developed the new website (a heavily modified wordpress install) in a sub-directory (eg: www.mywebsite.co.uk/new).

I would now like for my new website to replace my existing website, and for visitors to find the new site when they visit mywebsite.co.uk. How is this best achieved?

Any help is greatly appreciated,

Dan

3
  • i think you have to change the .htaccess file. like ` # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /new/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /new/index.php [L] </IfModule> # END WordPress` Hope its work fine.
    – Adi
    May 8, 2013 at 11:51
  • 1
    @Adi If you make this into an answer, you can format the code a lot more cleanly.
    – Pat J
    May 8, 2013 at 13:46
  • 3 answers and no comment. :S Why should I bother giving you an answer? (the 1 rep doesn't help)
    – Madivad
    Dec 29, 2014 at 11:53

3 Answers 3

1

I'd copy the wp subdirectory index.php to the top level, and edit the line

require('./wp-blog-header.php');

to be

require('./subdir/wp-blog-header.php');

and of course set the settings for site url and wordpress url to match as suggested above.

1
  • This has always been the right answer in my experience. Create the index.php in your root with require('./wp-blog-header.php'); pointing to the correct spot. Make sure you update the URL info in settings BEFORE doing this or you'll be fixing in DB-land
    – lacy
    Aug 31, 2018 at 18:00
1

Further to anmari's answer, the WP codex page that describes this in detail. You specifically are looking for "pre-existing subdirectlory".

0

Go to the the Settings page and change the wordpress address and site address to the correct url - http://www.mywebsite.co.uk/new

Alternatively, if you can't change it in the settings, you can do this in the database under the options table.

Wordpress will change your .htaccess file automatically after changing the settings.

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.