[英].htaccess URL rewrite rules folder
我在我的html文件夹中有这个
--html
--.htaccess
--app
--application_name
--public
--index.php
--landing_page
--index.php
到目前为止,每次访问网站URL(www.website.com)时,浏览器都会打开landing_page / index.php。
如何确保访问www.website.com/beta时,我将向html / app / application_name / public / index.php发送请求
我尝试将其添加到.htaccess
RewriteRule ^beta/?$ app/application_name/public/index.php [L,NC]
这是整个.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^beta/?$ app/application_name/public/index.php [L,NC]
但这行不通。 不确定使用什么术语来搜索这种问题。
您的根目录当前设置为/ html,因此RewriteBase /
位于/
, /beta/
根本不存在。 您可以更改RewriteBase /app/application_home/public/
并设置RewriteRule ^beta/?$ index.php [L,NC]
。 但是,这不再使您可以访问登录页面,不确定是不是您想要的?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.