Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2011-03-22 21:02:59
- jmart
- Member
- Registered: 2008-08-25
- Posts: 68
301 redirects
I’m trying to direct multiple pages of an old domain to a new domain). I’m trying to understand what’s wrong with my .htaccess file . Any thoughts?
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
redirect 301 http://www.old-domain.com/winter2011.asp http://www.newdomain.biz/
Last edited by jmart (2011-03-22 21:03:18)
Offline
Re: 301 redirects
In one of my sites where I have redirects, they are located immediately above the closing </IfModule>
.
Also, I presume both domains must point to the same directory, because if your www.old-domain.com is located elsewhere, that is where you need the redirects. In my own case where I have this, my line does not begin with a domain, e.g.
...
redirect 301 /winter2011.asp http://www.newdomain.biz/winter/
</IfModule>
#php_value register_globals 0
TXP Builders – finely-crafted code, design and txp
Offline
#3 2011-03-22 22:23:32
- jmart
- Member
- Registered: 2008-08-25
- Posts: 68
Re: 301 redirects
Well, client wants old domain to point to a new domain…for now. We’re testing stuff on the new domain. Once done, the new domain no longer exist and will simply point to the old domain
But there is no directory with the new domain. Just the domain itself.
Offline
Re: 301 redirects
As jakob says, the redirect will only work on the server which has the old domain. But you can test your redirects anyway.
redirect 301 /winter2011.asp http://www.newdomain.biz/winter/
will redirect http://www.newdomain.biz/winter2011.asp
to http://www.newdomain.biz/winter
Offline
Pages: 1