Apache 未能加载资源:net::错误\u名称\u未\u解析-在子域中
我想将我的工作网站移动到这样的子域Apache 未能加载资源:net::错误\u名称\u未\u解析-在子域中,apache,.htaccess,subdomain,Apache,.htaccess,Subdomain,我想将我的工作网站移动到这样的子域 web1.origdomain.com //working laravel web2.origdomain.com//working symfony web3.origdomain.com//not working plain html5 web1和web2自带.htaccess,而web3.htaccess是硬编码的,这意味着它是谷歌一些教程的复制粘贴。好吧,web3在开发机器中工作得非常好 localhost:8096 事实上,如果我通过临时调
web1.origdomain.com //working laravel
web2.origdomain.com//working symfony
web3.origdomain.com//not working plain html5
web1和web2自带.htaccess,而web3.htaccess是硬编码的,这意味着它是谷歌一些教程的复制粘贴。好吧,web3在开发机器中工作得非常好
localhost:8096
事实上,如果我通过临时调整Apache2,将web3移动到origdomain中,它将在生产环境中工作,比如
origdomain.com
这就是我在Apache2中创建web3.conf的方式
<VirtualHost *:80>
#ServerAdmin webmaster@localhost
DocumentRoot /var/www/web3
<Directory /var/www/web3/>
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog /var/www/web3/log/error.log
CustomLog /var/www/web3/log/access.log combined
</VirtualHost>
同样,如果web3作为
origdomain.com
而不是作为子域
web3.origdomain.com
这是web3的结构
web3
app
detect.php
log
web
css
js
about.php
index.php
.htaccess
index.php
你如何解决这个问题?
已启用重写模式我终于解决了它。这是我如何配置web3.conf的
<VirtualHost *:80>
ServerName web3.origdomain.com
ServerAlias web3.origdomain.com
DirectoryIndex index.html index.php
DocumentRoot /var/www/web3
<Directory "/var/www/web3">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
.....
.....
</VirtualHost>
服务器名web3.origdomain.com
ServerAlias web3.origdomain.com
DirectoryIndex.html index.php
DocumentRoot/var/www/web3
选项索引跟随符号链接多视图
允许超越所有
.....
.....
web3
app
detect.php
log
web
css
js
about.php
index.php
.htaccess
index.php
<VirtualHost *:80>
ServerName web3.origdomain.com
ServerAlias web3.origdomain.com
DirectoryIndex index.html index.php
DocumentRoot /var/www/web3
<Directory "/var/www/web3">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
.....
.....
</VirtualHost>