.htaccess URL重写根本不起作用

时间:2015-07-01 11:46:05

标签: .htaccess url rewrite

所以我有一个.haccess文件,用于将网址profile.php?user_username=Test重写为keepkey.96.it/test,但它不起作用。网址 保持不变。

这是我的.htaccess文件

RewriteBase /

RewriteEngine On

RewriteCond %{THE_REQUEST} \ /+profile\.php\?user_username=([^&\ ]+)
RewriteRule ^ /%1? [L,R]

RewriteRule ^/(.*)$ profile.php?user_username=$1 [L]

编辑:我已设法获取要重写的网址,现在显示为http://keepkey.96.lt/Test而不是http://keepkey.96.lt/profile.php?user_username=Test。但现在我收到error 404消息,有什么想法吗?

以下是错误消息:

Not Found

The requested URL /Test was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

0 个答案:

没有答案