Php 如何使用htaccess? 重新启动发动机
这是在我的服务器(mypage.com)上的.htaccess文件中 我怎样才能做到:Php 如何使用htaccess? 重新启动发动机,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,这是在我的服务器(mypage.com)上的.htaccess文件中 我怎样才能做到: 如果我打开here.mypage.com,则会将我重定向到mypage.com/here.html 如果我打开mypage.com/now,则会将我重定向到mypage.com/now/test.html 我的页面是用PHP编写的 试试看: <IfModule mod_rewrite.c> RewriteEngine On </IfModule> 尝试一下: <IfMod
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
尝试一下:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
这是第二个。首先,您必须使用您的网站cPanel(或类似网站)创建一个新的子域,并将子域指向主public_html文件夹,但我们可能需要有关您的服务器的更多信息来提供确切的帮助
编辑:
RewriteEngine on
RewriteRule ^now$ now/test.html
这应该是子域
这是第二个。首先,您必须使用您的网站cPanel(或类似网站)创建一个新的子域,并将子域指向主public_html文件夹,但我们可能需要有关您的服务器的更多信息来提供确切的帮助
编辑:
RewriteEngine on
RewriteRule ^now$ now/test.html
这应该是子域
1.如果我打开here.mypage.com,则会将我重定向到mypage.com/here.html
只要here.mypage.com与htaccess文件所在的文档根目录相同,请添加:
RewriteCond %{HTTP_HOST} ^here.mypage.com [NC]
RewriteRule ^/here.html [L]
2.如果我打开mypage.com/now,则会将我重定向到mypage.com/now/test.html
加:
1.如果我打开here.mypage.com,则会将我重定向到mypage.com/here.html
只要here.mypage.com与htaccess文件所在的文档根目录相同,请添加:
RewriteCond %{HTTP_HOST} ^here.mypage.com [NC]
RewriteRule ^/here.html [L]
2.如果我打开mypage.com/now,则会将我重定向到mypage.com/now/test.html
加:
若要将here.mypage.com重定向到mypage.com/here.html,需要的不仅仅是将规则添加到.htaccess(请参见=>) 对于另一个,您可以添加:
RewriteCond %{HTTP_HOST} ^mypage\.com$ [NC]
RewriteRule ^now$ /now/test.html [L]
若要将here.mypage.com重定向到mypage.com/here.html,需要的不仅仅是将规则添加到.htaccess(请参见=>) 对于另一个,您可以添加:
RewriteCond %{HTTP_HOST} ^mypage\.com$ [NC]
RewriteRule ^now$ /now/test.html [L]
主机名在
重定向
directive的正则表达式中无法匹配主机名在重定向
directive的正则表达式中无法匹配我有子域,但现在我想从子域重定向到此地址我有子域,但现在我想从子域重定向到此地址