如何解决apache - 将不同的子域重定向到不同的路径
目前我的网址是这样工作的:
example.com -> https://example.com/#/home (port 80)
admin.mydomain.com -> https://example.com/#/auth/login (port 81)
dispatcher.example.com -> https://dispatcher.example.com/#/auth/login (port 81)
但是,我希望 dispatcher.example.com
指向 https://dispatcher.example.com/#/auth/dispatcher/login
这是我的虚拟主机配置文件:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/website/dist/website-user-panel
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:81>
ServerName dispatcher.example.com
DocumentRoot /var/www/html/myfolder/dist
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:81>
ServerName admin.example.com
DocumentRoot /var/www/html/myfolder/dist
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
这里是 /var/www/html/myfoler/dist
中的 .htaccess 文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /#/auth/login
RewriteCond %{HTTP_HOST} ^dispatcher.ways-cars.com
RewriteRule /#/auth/login /#/auth/dispatcher/login
</IfModule>
但这仍然是指导dispatcher.example.com -> https://dispatcher.example.com/#/auth/login
任何形式的帮助将不胜感激。谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。