TransWikia.com

Why my wp site always redirecting to the old website path..?

WordPress Development Asked by priya on January 26, 2021

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.com.au/

But it’s always redirected to the old existing website path which is

http://www.macil.com.au/Welcome/Home.html

I’ve checked the htaccess file, it is blank what can be the issue?

2 Answers

.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.com.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.com/test.

I'm ready to answer any questions!

Hope that helps :)

Answered by Neil on January 26, 2021

Did 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.

Answered by jdm2112 on January 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP