htaccess规则重定向没有页面名称的用户

时间:2014-10-27 21:10:36

标签: .htaccess

我的index.php页面在流程results.php?token=0e635edc03之后重定向到此类网址。

现在我想隐藏results.php。所以只需:domain.com/0e635edc03

我需要.htaccess规则吗?

我需要执行哪个.htaccess规则?

感谢。

1 个答案:

答案 0 :(得分:0)

尝试将此添加到文档根目录中的htaccess文件:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-f]+)$ /results.php?token=$1 [L,NC]

现在您需要确保index.php文件重定向到domain.com/0e635edc03而不是results.php网址。