开发者

URL redirect using .htaccess gives 500 Internal Server Error

I'm trying to redirect anyone surfing to http://forum.student.khleuven.be to http:// forum.kringraad.be. Both URL's redirect to the same directory, basically. I tried the following using .htaccess:

Redirect permanent http://forum.student.khleuven.be/ http://forum.kringraad.be/

and also the following:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^forum\.student\.khleuven\.be$ [NC]
RewriteRule ^(.*)$ http://forum.kringraad.be/$1 [R=301,L]
</IfModule>

Both give me a 500 Internal Server Error. I double checked that mod_rewrite is enabled, and it is. I'm pretty clueless, to be honest :) Anyone know what to d开发者_运维百科o?


Apparently the solution was this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^forum.student.khleuven.be$ [NC]
RewriteRule ^(.*)$ http://forum.kringraad.be/$1 [R=301,L]
</IfModule>

I just had to remove the escapes. I don't know why I don't have to escape those dots, but it works perfectly like this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜