search

Home  >  Q&A  >  body text

apache - Why are localhost used as the URL prefix when accessing images and css files in the WordPress blog I built?

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

天蓬老师天蓬老师2747 days ago744

reply all(5)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:04:58

    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.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 17:04:58

    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.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 17:04:58

    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.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 17:04:58

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

    reply
    0
  • 某草草

    某草草2017-05-16 17:04:58

    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/

    reply
    0
  • Cancelreply