301 error after moving domain
-
I tried moving a site on a development domain to it’s production domain. I’m running an Ubuntu 18.04 VPS and Nginx 1.14.0
How I did the move: First I added the correct IP to the new domain in the admin panel for my domain registrar
I then updated to the correct URL in the WordPress admin dashboard.
I then ran certbotsudo certbot --nginx -d oslopeace19.noto get the correct certificates for my site.But when I tested the site nginx redirects me to the default site instead of the site I set up.
I’ve debugged for almost a full day, now I’ve removed the HTTPS certs, but I’m still getting the same error. the weird thing is that when I run
curl -v http://oslopeace19.noI get the message... < X-Redirect-By: WordPress ...This leads me to think that WordPress is doing something weird here. To try and solve this I’ve set
define('WP_HOME','http://oslopeace19.no'); define('WP_SITEURL','http://oslopeace19.no'); define('RELOCATE', true);in
wp-config.phpand manually verified that the correct URL is set for siteurl and home in the wordpress database.Nginx conf:
server { listen 80; listen [::]:80; #Logger access_log /var/log/nginx/oslopeace19; error_log /var/log/nginx/error_oslopeace19; #Sikkerhet add_header X-Content-Type-Options nosniff; add_header X-Frame-Options SAMEORIGIN; add_header X-XSS-Protection "1; mode=block"; add_header Content-Security-Policy "frame-ancestors 'self'"; server_tokens off; index index.php; ## Begin - Server Info root /var/www/oslopeace19; server_name oslopeace19.no; ## End - Server Info ## Begin - Index # for subfolders, simply adjust the rewrite: # to use <code>/subfolder/index.php</code> location / { try_files $uri $uri/ /index.php?$query_string; } ## End - Index location = /.user.ini { deny all; } ## Begin - PHP location ~ \.php$ { # Choose either a socket or TCP/IP address fastcgi_pass unix:/run/php/php7.2-fpm.sock; # fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; } ## End - PHP ## Begin - Security # deny all direct access for these folders location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; } # deny running scripts inside core system folders location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } # deny running scripts inside user folder location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } # deny access to specific files in the root folder location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; } ## End - Security }Site URL is oslopeace19.no, any suggestions?
- This topic was modified 6 years, 9 months ago by . Reason: formatting errors
- This topic was modified 6 years, 9 months ago by .
The page I need help with: [log in to see the link]
The topic ‘301 error after moving domain’ is closed to new replies.