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