简体   繁体   中英

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 do?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM