apache - Why are localhost used as the URL prefix when accessing images and css files in the WordPress blog I built?
天蓬老师
天蓬老师 2017-05-16 17:02:58
0
5
770

Question 1: It hasn’t been assigned a domain name yet. Is this the reason?
Question 2: Now I just want to be able to access it in the local area network (wifi). How can I set it up?

Environment: ubuntu+apache+php+wordpress are all the latest

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(5)
给我你的怀抱

This is particularly bad with WordPress. After you configure a domain name during installation, you can only access it using that domain name.

In my old notes, changing the WordPress domain name requires five SQL statements. I don't know if it works for the current version yet.

左手右手慢动作

1. Specify a URL or IP in wordpress.
2Set the listening IP in your Apache conf as: *
Bind host on the router or bind host 192.168.1.101 www.nb.com
on all access points In this way you can use nb.com to access your LAN website.

習慣沉默

Maybe this is the trouble caused by messing around without watching the tutorial. (After tinkering all night...)

Note 1: My blog directory is placed in /var/www/html/blog, localhost=/var/www/html/
Note 2: X代表IP域名localhost

below

If you use X/blog进入wordpress目录从而自动跳转到X/blog/wp-admin/setup-config.php开始安装过程,则以后博客中的页面在正常跳转(不包括自己写的外链接)的时候也是以X开头的。X可能是一个IP地址,也可能是一个域名,也可能是localhost.如果自己配置远程服务器,买了域名的自然要以域名/blog进行安装为最佳,我只是局域网中自个儿玩的,就以局域网IP/blog开始安装,如果是本机上自己玩,则localhost/blog.

phpcn_u1582

Yes, this will actually change with your domain name. You can try configuring a host.

某草草

In fact, there is a method of binding multiple domain names that can solve your problem. Look here http://www.wpzhiku.com/the-methods-of-bind-multi-domain/

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template