rewriterule help?

rewriterule help?

Hetz Ben Hamo hetzbh at gmail.com
Fri Apr 22 12:10:02 IDT 2011


Hi,

I haven't touched for quite a long time rewriterule in apache. Could someone
help me a bit? :)

I have one domain which is hosting my blog and I'm changing the blog domain
name, so natually I want the rewriterule to replace automatically everyone
that comes from domain blog.hetz.biz (old domain) to vps.net.bz (new
domain).

At first I thought adding a simple ServerAlias and be done with it. It seems
to work technically but it misses the point, I want to move permanently
(301)

I wrote this file in the conf directory (it's centos)

<VirtualHost *:80>
ServerAdmin hetz at benhamo.org
DocumentRoot /home/xxxx/blog
ServerName vps.net.bz
ErrorLog /home/xxxx/logs/vps-net_biz-error_log
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
CustomLog /home/hetz/www/logs/vps-net-biz-access_log combined

Options +FollowSymLinks
RewriteEngine On
RewriteOptions Inherit
RewriteCond %{HTTP_HOST} ^blog\.hetz\.biz$ [NC]
RewriteRule ^(.*)$ http://vps.net.bz/$1 [R=301,L]
</VirtualHost>

At the moment what this does is just skipping my entire blog and jumps
directly to my personal blog.

What am I missing here?

Thanks,
Hetz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20110422/4c856227/attachment.html>


More information about the Linux-il mailing list