After changing domain name of wordpress site only default permalinks working wordpress others returns 404 error

流过昼夜 提交于 2021-01-29 12:32:19

问题


I will be really thankfull for any help, because After reading and trying a lot of tutorials, i have not found any solution. After i change domain name from www.examlpe.fr to www.newExample.fr, i have only the home page works successfully but others links returns 404 not found error. I try to manage this with Permalinks, i found only the default permalink works.

in wp_config i set:

define( 'WP_HOME', 'http://newExample.fr' );
define( 'WP_SITEURL', 'http://newExample.fr' );

Also in functions.php i set:

update_option( 'siteurl', 'http://newExample.fr' );
update_option( 'home', 'http://newExample.fr' );

my .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

In addition, i try to update .htaccess(to make an old one and to create a blank one) file and edit permissions while editing primalinks

Also i have change in mysite.conf to replace AllowOverride None --> AllowOverride All

thank you in advance for your help


回答1:


Do you have access to your WordPress dashboard? If so try to go there under settings -> permalinks just open that page and press save once. After that your sites should work.




回答2:


For 4 years I use Search-Replace-DB to fix that kind of issues. Wordpress keep in your DB the old urls. First you need to download and read the README Search-Replace-DB

Try follow the next step:

1- Copy the whole folder inside your wordpress site. I assume you download or clone the previously repository link.

mv Search-Replace-DB /my/web/site

2- open a browser and go to mydomain.com/Search-Replace-DB

You will get a dashboard very nice, its very intuitive.




回答3:


it's resolved i'm sure from the beginnig that was the activation of rewrite rules from my server center.



来源:https://stackoverflow.com/questions/58973585/after-changing-domain-name-of-wordpress-site-only-default-permalinks-working-wor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!