Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-01 09:45:15

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

.htaccess question

Here’s the thing. I have 2 domeins pointing to my site, the new one is the one I want all people to go to, so I would like to when people type in the old domain, still get the new one, and I bet .htaccess can resolve this for me. So this is what I’ve tried:
<pre>Redirect permanent http://semperfi-1982.com http://dnevnikeklektika.com</pre>
And guess what—when I type http://semperfi-1982.com and hit go, I still get semperfi-1982.com and not dnevnikeklektika.com. i have placed the rule on the verry top of the TXP-s .htaccess so now it looks like this:

<pre>Redirect permanent http://semperfi-1982.com http://dnevnikeklektika.com
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule></pre>

Last edited by Dragan (2005-11-01 09:46:30)

Offline

#2 2005-11-01 09:49:39

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: .htaccess question

Use the following if you want to redirect based on the domain.
<pre>
RewriteCond %{HTTP_HOST} semperfi-1982.com
RewriteRule ^(.*)$ http://dnevnikeklektika.com/$1 [R=permanent,L]
</pre>

Offline

#3 2005-11-01 09:52:08

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: .htaccess question

whooooah man, works like a charm :D, thanx heaps …

Offline

#4 2005-11-01 11:57:51

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: .htaccess question

And the problem with the first one was that that sort of redirect expects a relative URL, not an absolute one, as its first argument. So Redirect permanent / http://dnevnikeklektika.com would probably have worked.


You cooin’ with my bird?

Offline

#5 2005-11-01 12:00:53

Dragan
Member
From: Novi Sad, Serbia
Registered: 2005-10-26
Posts: 100
Website

Re: .htaccess question

^ yes, I have taken that form an example that had a relative path. it is more for the like of:
<pre>Redirect permanent /folio http://dnevnikeklektika.com/archive/folio</pre>

Offline

Board footer

Powered by FluxBB