最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Localhost wordpress problem

programmeradmin1浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 0

Try 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.)

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论