I recently had to upload my wordpress website from live host (cpanel) to my localhost. (Took database from cpanel and updated it and changed the url settings in my database) Now when im entering the url http://localhost:8080/xxx/ the page url redirects to http://localhost/xxx/ and is showing an error. I can visit http://localhost:8080/xxx/wp-admin and all my pages but the home url/redirect is broken.
Anyone know why this happening?
I recently had to upload my wordpress website from live host (cpanel) to my localhost. (Took database from cpanel and updated it and changed the url settings in my database) Now when im entering the url http://localhost:8080/xxx/ the page url redirects to http://localhost/xxx/ and is showing an error. I can visit http://localhost:8080/xxx/wp-admin and all my pages but the home url/redirect is broken.
Anyone know why this happening?
Share Improve this question asked Jun 5, 2019 at 12:23 DennisDennis 216 bronze badges2 Answers
Reset to default 0Try to look in your wp-config.php for the siteurl. Maybe this gives some inspiration? Im a newb in wordpress but maybe this will help?
Add this to your htaccess
file.
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^ http://%{HTTP_HOST}:8080%{REQUEST_URI} [P]
This will redirect any port 80 request to port 8080. Place in the root folder of your site.
You could also put the port 80 in your site URLs in the wp-options table. Use like http://localhost:8080
, adjusting as needed.
(Note; you could change the URLs in the wp-config.php
file, but I'm not a big fan of that. Although I might be convinced to put the 'live' URL in the wp-options
table, and then overriding that on your dev system by setting those values in the wp-config.php
on the dev system. As long as you don't transfer the wp-config.php
file to production.)