I am having problem on migrating my Wordpress site from the sub folder to the root directory.
My current website URL is not working on uploading the project on root directory. It's get redirected to the existing path
My current word press site is located on root directory
/
But it's always redirected to the old existing website path which is
.html
I’ve checked the htaccess file, it is blank what can be the issue?
I am having problem on migrating my Wordpress site from the sub folder to the root directory.
My current website URL is not working on uploading the project on root directory. It's get redirected to the existing path
My current word press site is located on root directory
http://www.macil.au/
But it's always redirected to the old existing website path which is
http://www.macil.au/Welcome/Home.html
I’ve checked the htaccess file, it is blank what can be the issue?
Share Improve this question edited Aug 25, 2014 at 14:20 Pieter Goosen 55.4k23 gold badges115 silver badges210 bronze badges asked Aug 25, 2014 at 13:07 priyapriya 11 silver badge1 bronze badge 2- I don't see any redirect on your site – Mark Kaplun Commented Aug 26, 2014 at 11:35
- - Check your Data Base -> wp_options (table) -> 'siteurl' and 'home'(entries) and manually change change for your current site URL. Back your DB before making any changes, in case! – Tara Commented Aug 26, 2014 at 15:56
2 Answers
Reset to default 0Did you update the URL in the DB? It sounds like the site still thinks it's running in the old location which usually indicates the DB still has the old path in it.
I highly recommend the Search and Replace tool that Interconnect IT produces. The stable 2.1 version is my preference.
Make sure you remove this script when you have finished. It's an open door for bad actors into your DB.
.htaccess is not a problem for that, but be care with security.
I'm searching and I found the solution here: Giving WordPress Its Own Directory
1- Check your index.php (located at 'public_html') and write on: require( dirname( __FILE__ ) . '/<your-tree-directory>/wp-blog-header.php' );
in your case: require( dirname( __FILE__ ) . '/wp-blog-header.php' );
(if your wordpress files are located at 'public_html').
2- Check your DB and go to: -> wp_options (table) -> 'siteurl' and
'home'(entries) and change for your current site URL. In your case: http://www.macil.au/
3- .htaccess file (added in 'public_html' and in your tree directory):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test/index.php [L]
</IfModule>
# END WordPress
'test' is the URL that you prefer like: www.mydomain/test.
I'm ready to answer any questions!
Hope that helps :)