Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度7.子域访问_Angular_.htaccess - Fatal编程技术网

Angular 角度7.子域访问

Angular 角度7.子域访问,angular,.htaccess,Angular,.htaccess,出于某种原因,standard.htaccess正在使用标准的www.domain.com url,但对于子域app.domain.com,无论采用何种.htaccess配置,刷新页面时我都会得到404。有什么想法吗? 当前文件: <IfModule mod_rewrite.c> RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCo

出于某种原因,standard.htaccess正在使用标准的www.domain.com url,但对于子域app.domain.com,无论采用何种.htaccess配置,刷新页面时我都会得到404。有什么想法吗? 当前文件:

<IfModule mod_rewrite.c>
  RewriteEngine On
    # If an existing asset or directory is requested go to it as it is
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
    RewriteRule ^ - [L]
    # If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
</IfModule>

重新启动发动机
#如果请求了现有资产或目录,请按原样转到该资产或目录
RewriteCond%{DOCUMENT_ROOT}%{REQUEST_URI}-f[或]
重写cond%{DOCUMENT\u ROOT}%{REQUEST\u URI}-d
重写规则^-[L]
#如果请求的资源不存在,请使用index.html
重写规则^/index.html
Apache配置文件:

<VirtualHost *:80>
    ServerAdmin user@gmail.com
    ServerName app.domain.com
    ServerAlias app.domain.com
    DocumentRoot /var/www/app.domain.com/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/app.domain.com/html">
  AllowOverride All
</Directory>

服务器管理员user@gmail.com
ServerName app.domain.com
ServerAlias app.domain.com
DocumentRoot/var/www/app.domain.com/html
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
允许超越所有

子域文件夹中的My htaccess文件

.htaccess

RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /subfolder-name/index.html
index.html

 <base href="/subfolder-name/">


希望这将有助于

我的htaccess子域文件夹中的文件

.htaccess

RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /subfolder-name/index.html
index.html

 <base href="/subfolder-name/">


希望这会有所帮助

您能给出服务器的目录屏幕截图吗?这将有助于快速解决此问题。添加了Apache Conf。希望此帮助扫描您提供服务器的目录屏幕截图?这将有助于快速解决此问题。添加了Apache Conf。希望此帮助文件不是子文件夹。它是指向虚拟主机根文件夹的子域,但不是子文件夹。它是指向虚拟主机根文件夹的子域