<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Diary &#187; httpd</title>
	<atom:link href="http://andriigrytsenko.net/tag/httpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Tue, 17 Aug 2010 08:25:33 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Make redirection from one web site to another via htaccess</title>
		<link>http://andriigrytsenko.net/2009/06/make-rediraction-from-one-domain-to-another-via-htaccess/</link>
		<comments>http://andriigrytsenko.net/2009/06/make-rediraction-from-one-domain-to-another-via-htaccess/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 13:01:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[httpd]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=86</guid>
		<description><![CDATA[Here is some example how to redirect web users from one domain to another one.

In the event of you have 2 domains and you want to use one of this as general one. And redirect all requests from one domain to another one.  For example redirect requests from test.com.ua to test.com you need to [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some example how to redirect web users from one domain to another one.<br />
<span id="more-86"></span><br />
In the event of you have 2 domains and you want to use one of this as general one. And redirect all requests from one domain to another one.  For example redirect requests from test.com.ua to test.com you need to install apache with mod_rewrite module. For debian you have to make next command(as root): </p>
<pre>
#cd /etc/apache2/mods-enabled
# ln -s ../mods-available/rewrite.load  rewrite.load
</pre>
<p>For another distros you able to compile apache from sources with option &#8220;&#8211;enable-module=rewrite&#8221;. </p>
<p>Also you should put or change some lines in the apache configuration file (apache2.conf OR httpd.conf). In main section: </p>
<pre>
AccessFileName .htaccess
</pre>
<p>In the Directory section : </p>
<pre>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</pre>
<p>After that restart apache server: </p>
<pre>
# /etc/init.d/apache2 restart</pre>
<p>Now you are ready to make your .htaccess file. Go to the your web directory: </p>
<pre># cd /var/www/
# cat > .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^test\.com\.ua$
RewriteRule (.*) http://test.ua/$1 [L,R]</pre>
<p>Check your web site via browser. If you have done everything describe above in proper way you will be redirected from test.com.ua to test.ua. </p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/06/make-rediraction-from-one-domain-to-another-via-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
