试图设置友好的URL

时间:2014-04-15 21:01:42

标签: apache .htaccess mod-rewrite redirect

我正在尝试为我的网站配置一个友好的网址系统,由于我是这些工具的新手,我第一次在我的客户端localhost上进行测试。

事实是我想转换此网址: http://laventanaindiscretadiego.url.ph/page/index.inc.php?lang=en_EN 进入另一个 http://laventanaindiscretadiego.com/main

因为我正在使用.htaccess文件而我正在使用RewriteRule,因为我在这里显示

RewriteRule ^/laventana/page/main$ /laventana/page/index.inc.php?lang=$1

在我的.htaccess上应用更改后,我保存了所有内容,没有任何反应,网址也没有重写。

作为一个额外的信息,httpd.conf已经被编辑,删除了下一个通道的注释:

LoadModule rewrite_module modules/mod_rewrite.so

我还检查了AllowOverride在选项All中,你可以看到:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

我还检查过文档根目录是正确的,在我的情况下:

DocumentRoot "C:/xampp/htdocs"

我可以说的最后一件事是,.htaccess文件位于根文件夹(htdocs)中,所以它有意义,我之前通过简单的重定向测试了它,就像在这个例子中一样

Redirect /laventana/page/index.inc.php?lang=$1 http://www.disney.com

重定向是愚蠢的,但我想测试.htaccess正在运行。

有没有人知道我发生了什么和/或我有什么错误?

谢谢!

0 个答案:

没有答案