我是htaccess的新手,需要关于重定向路径到子域路径的帮助。
我的子域是
Subdomain : https://abc.example.com/,它指向路径。
Path : https://example.com/folder1/abc现在我想如果有人正在使用路径访问目录,它应该重定向到子域
Request : https://example.com/folder1/abc/folder2/file
Redirect : https://abc.example.com/folder2/file我搜索了很多,但没能继续。任何形式的帮助都将不胜感激。
完成我的htaccess文件
RewriteEngine on
RewriteCond %{HTTP_HOST} !^api\. [NC]
RewriteRule .* https://api.example.com/$0 [L,NE,R=301]
ErrorDocument 403 /error-pages/403.php
ErrorDocument 404 /error-pages/404.php发布于 2018-01-31 15:57:24
在folder1/abc/.htaccess中,将此规则作为您的第一条规则:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^abc\. [NC]
RewriteRule .* http://abc.example.com/$0 [L,NE,R=301]https://stackoverflow.com/questions/48537015
复制相似问题