Php 如何在非索引页面上创建漂亮的URL?

Php 如何在非索引页面上创建漂亮的URL?,php,.htaccess,Php,.htaccess,我很抱歉让你们为我胡思乱想。 这就是我的情况: 在我的htdocs文件夹中,我有一个名为mediaschedulesgh的文件夹。 在mediaschedulesgh中,我拥有所有web文件。所以,它是我的根文件夹。index.php、加纳电台.php和htaccess与其他文件夹一起位于mediaschedulesgh中。 我想要达到的是重写 ^加纳广播电台\/([^/]*)$内部到 ghana-radio-stations.php?region=$1 [L] 这是my.htaccess文件

我很抱歉让你们为我胡思乱想。 这就是我的情况: 在我的htdocs文件夹中,我有一个名为mediaschedulesgh的文件夹。 在mediaschedulesgh中,我拥有所有web文件。所以,它是我的根文件夹。index.php加纳电台.phphtaccess与其他文件夹一起位于mediaschedulesgh中。 我想要达到的是重写
^加纳广播电台\/([^/]*)$
内部到

ghana-radio-stations.php?region=$1 [L]
这是my.htaccess文件中的规则:

RewriteEngine On
RewriteRule ^ghana-radio-stations\/([^/]*)$ ghana-radio-stations.php?region=$1 [L]
我希望这个url
加纳电台/ashanti
映射到
加纳电台.php?region=ashanti


但这会导致页面未找到错误。

文件gena-radio-stations.php是否存在?为什么不喜欢
RewriteRule^加纳广播电台\/([^/]*)$index.php?region=$1[L]
?是的,文件存在。那么什么不起作用呢?显示到目前为止您已经尝试过的内容…当我单击根目录中的index.php、gana-radio-stations.php和.htaccess文件时,我想要运行