Php .htaccess文件名到url

Php .htaccess文件名到url,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我一直在寻找,找不到适合我需要的答案。我想这是一个相当简单的问题 关键是我需要把我的文件改写成我喜欢的名字。例如,我有“www.mydomain.com/account_index.php”,我想将其重写为www.mydomain.com/account 到目前为止,我有这个,但这似乎不适用于多行 Rewriteengine on rewriterule ^support account_ticket.php [L] rewriterule ^account account_index.php

我一直在寻找,找不到适合我需要的答案。我想这是一个相当简单的问题

关键是我需要把我的文件改写成我喜欢的名字。例如,我有“www.mydomain.com/account_index.php”,我想将其重写为www.mydomain.com/account

到目前为止,我有这个,但这似乎不适用于多行

Rewriteengine on
rewriterule ^support account_ticket.php [L]
rewriterule ^account account_index.php [L]
简而言之,我希望我的网站将/account重定向到account_index.php,反之亦然


提前谢谢

我为那些好奇的人找到了答案。 我必须在每个
重写规则
之前加上一个
重写条件

所以如果我想去www.mydomain.com/account。我要这个:

RewriteCond %{REQUEST_URI} ^/account$ [NC]
RewriteRule ^account account_index.php [NC,L]
这意味着/account现在链接到account_index.php


祝你今天愉快

重写规则^support$Path/your_php_file_name.php