Apache 使用.htaccess进行优先级重定向
我想在我的Apache 使用.htaccess进行优先级重定向,apache,.htaccess,Apache,.htaccess,我想在我的.htaccess中设置优先级 好的,我的根项目中有文件夹,模式: -root: -core -includes -pages: - profile.php -etc -support -infractions -.htaccess 我想做的是: 如果URL类似于https://example.com/support,显示/support/index.php。 我尝试了-index选项,但它不起作用或不满足我的需要 我的.htaccess类
.htaccess
中设置优先级
好的,我的根项目中有文件夹,模式:
-root:
-core
-includes
-pages:
- profile.php
-etc
-support
-infractions
-.htaccess
我想做的是:
如果URL类似于https://example.com/support
,显示/support/index.php
。
我尝试了-index
选项,但它不起作用或不满足我的需要
我的.htaccess
类似于:
Options +FollowSymlinks
Options +Indexes
Options -MultiViews
RewriteEngine On
RewriteCond %{HTTP_HOST} ^fenixcms\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://fenixcms.com/$1 [R,L]
RewriteBase /
DirectoryIndex pages/index.php
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^alert/([^/\.]+)/?$ pages/alert.php?id=$1 [L]
RewriteRule ^player/([^/\.]+)/?$ pages/profile.php?name=$1 [L]
RewriteRule ^forums/new_topic/([^/\.]+)/?$ /forums/new_topic.php?c=$1 [L]
RewriteRule ^forums/topics/([^/\.]+)/posts/edit/([^/\.]+)/?$ /forums/edit_post.php?tid=$1&pid=$2 [L]
RewriteRule ^forums/topics/([^/\.]+)/posts/new/?$ /forums/new_post.php?tid=$1 [L]
RewriteRule ^forums/topics/([^/\.]+)/posts/reply_to_id/([^/\.]+)/?$ /forums/new_quote.php?tid=$1&pid=$2 [L]
RewriteRule ^forums/topics/([^/\.]+)/edit/?$ /forums/edit_topic.php?tid=$1 [L]
RewriteRule ^forums/topics/([^/\.]+)/?$ /forums/topic.php?id=$1 [L]
RewriteRule ^forums/topics/([^/\.]+)/posts/delete/([^/\.]+)/?$ /forums/delete_post.php?tid=$1&pid=$2 [L]
RewriteRule ^forums/categories/([^/\.]+)/?$ /forums/categories.php?s=$1 [L]
RewriteRule ^forums/posts/([^/\.]+)/?$ /forums/posts.php?pid=$1 [L]
RewriteRule ^forums/([^/\.]+)/?$ /forums/$1.php [L]
RewriteRule ^revisions/([^/\.]+)/?$ pages/revisions.php?action=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)/([^/\.]+)/?$ /$1/$2.php [L]
RewriteRule ^([^\.]+)/?$ /$1/index.php [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ pages/$1.php [NC,L]
@anubhava但我的索引页在页面上folder@anubhava请再次阅读问题:),更改我的目录索引不会改变我的问题的任何内容