<div dir="ltr"><br><br><div class="gmail_quote">2011/4/22 Hetz Ben Hamo <span dir="ltr"><<a href="mailto:hetzbh@gmail.com">hetzbh@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">
<div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">I haven't touched for quite a long time rewriterule in apache. Could someone help me a bit? :)</div><div dir="ltr"><br></div><div dir="ltr">
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 <a href="http://blog.hetz.biz" target="_blank">blog.hetz.biz</a> (old domain) to <a href="http://vps.net.bz" target="_blank">vps.net.bz</a> (new domain).</div>
<div dir="ltr"><br></div><div dir="ltr">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)</div><div dir="ltr"><br></div>
<div dir="ltr">I wrote this file in the conf directory (it's centos)</div><div dir="ltr"><br></div><div dir="ltr"><VirtualHost *:80></div><div dir="ltr"><div dir="ltr">ServerAdmin <a href="mailto:hetz@benhamo.org" target="_blank">hetz@benhamo.org</a></div>
<div dir="ltr">DocumentRoot /home/xxxx/blog</div><div dir="ltr">ServerName <a href="http://vps.net.bz" target="_blank">vps.net.bz</a></div><div dir="ltr">ErrorLog /home/xxxx/logs/vps-net_biz-error_log</div><div dir="ltr">
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined</div>
<div dir="ltr">CustomLog /home/hetz/www/logs/vps-net-biz-access_log combined</div><div dir="ltr"><br></div><div dir="ltr">Options +FollowSymLinks</div><div dir="ltr">RewriteEngine On</div><div dir="ltr">RewriteOptions Inherit</div>
<div dir="ltr">RewriteCond %{HTTP_HOST} ^blog\.hetz\.biz$ [NC]</div><div dir="ltr">RewriteRule ^(.*)$ <a href="http://vps.net.bz/$1" target="_blank">http://vps.net.bz/$1</a> [R=301,L]</div><div dir="ltr"></VirtualHost></div>
<div><br>
</div><div>At the moment what this does is just skipping my entire blog and jumps directly to my personal blog.</div><div><br></div><div>What am I missing here?</div><div><br><br></div></div></div></blockquote><div><br>You're saying you want to apply something to the site <a href="http://blog.hetz.biz">blog.hetz.biz</a> - but - the configuration snippet you've pasted, deals with a different domain - <a href="http://vps.net.bz">vps.net.bz</a> (as per the ServerName directive). <br>
<br>Unless I am missing something very obvious - that configuration snippet is not even supposed to have any influence on <a href="http://blog.hetz.biz">blog.hetz.biz</a> - unless all your domains share the same website and there's no NameVirtualHost directive on the global configuration at all...<br>
<br>-- Shimi<br></div></div><br></div>