|
|
|
|
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
Post
#1
Oct 5 2005, 01:07 AM
I want to redirect all my traffic from one site to another domain name. Is this possible, and if so, would I do something like this: .htaccess code: CODE redirect 302 / http://www.mynewdomain.com Thanks! |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 516 Joined: 29-April 05 From: Canada Eh?!? Member No.: 6,408 |
Post
#2
Oct 5 2005, 02:52 AM
Well, it seems to me that if you made your 404 error page so that it contined a javascript redirect that should do the trick.
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 873 Joined: 30-July 04 Member No.: 246 |
Post
#3
Oct 5 2005, 03:34 AM
You have a couple of options, the simplest of which you have already mentioned (although I would recommend using a 301/permanent redirect over a 302/temporary equivalent). Note that you can use 'temp' or 'permanent' in place of the HTTP request codes. Also try looking up the RewriteRule (or mod_rewrite) |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 873 Joined: 30-July 04 Member No.: 246 |
Post
#4
Oct 5 2005, 03:37 AM
Oh, you can also redirect access via PHP, using the header() function: CODE // Permanent redirect:
header('HTTP/1.1 301 Moved Permanently', true); header('Location: http://www.location.com/'); // Temporary redirect (note that sending the 'Location' header automatically sends a 302 redirect unless it is explicitly overwritten, as it is above): header('Location: http://www.location.com/'); |
![]() Group: Admin
Posts: 1,563 Joined: 11-June 04 From: Somewhere in Time & Space. Member No.: 1 myCENT:10.74 |
Post
#5
Oct 5 2005, 06:52 AM
Cpanel gives you options for permanent and temporary redirect. Check it out at your Cpanel.
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
Post
#6
Oct 5 2005, 09:18 PM
So basically, I could do it my way (stated in the first post) or I could write put headers into the pages that I want redirected? By the way, what's the difference between permanent and temporary? I mean, if you put it at permanent (301), then you can always edit the php file, right? Then isn't that temporary? |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 873 Joined: 30-July 04 Member No.: 246 |
Post
#7
Oct 6 2005, 01:37 AM
The idea is that a temporary redirect indicates that the original page is going to be restored at some stage soon, and a permanent redirect means it's not coming back (or at least, won't be there for an extended period). For example, if you are doing site maitainance and don't want any of your pages viewed during the process, you might '302' them to, say, '/message.html' to inform them of this. But if you renamed your page from '/page.html' to '/otherpage.html', you might want to permanently redirect traffic from the former to the latter. Most search engines also treat 301 and 302 redirection very differently. If you change your site to another domain name, then it is generally a good idea to use permanent redirects to point to your new domain name, informing the search engine that your site has been moved. |
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
15 | chelcy | 1,484 | 29th July 2004 - 12:46 AM Last post by: football123213 |
|||
![]() |
5 | juliagizzle | 679 | 17th July 2004 - 02:22 PM Last post by: OpaQue |
|||
![]() |
7 | andyy15 | 322 | 13th August 2004 - 06:10 PM Last post by: odomike |
|||
![]() |
10 | outwarsecrets | 938 | 9th August 2004 - 06:34 AM Last post by: Spectre |
|||
![]() |
9 | CodeName_88 | 442 | 13th August 2004 - 10:19 PM Last post by: annylei |
|||
![]() |
5 | KKI | 186 | 13th August 2004 - 10:08 AM Last post by: OpaQue |
|||
![]() |
10 | wassie | 1,071 | 13th August 2004 - 09:25 PM Last post by: wassie |
|||
![]() |
6 | sjc | 418 | 27th October 2004 - 06:09 PM Last post by: mohit-vohra |
|||
![]() |
1 | Mario | 562 | 20th August 2004 - 12:29 AM Last post by: ill |
|||
![]() |
3 | CuM2cmU | 239 | 21st August 2004 - 03:56 PM Last post by: OpaQue |
|||
![]() |
1 | eforumhongkong | 510 | 21st August 2004 - 05:22 PM Last post by: OpaQue |
|||
![]() |
5 | Zac | 336 | 27th August 2004 - 11:00 PM Last post by: Spectre |
|||
![]() |
2 | annylei | 313 | 28th August 2004 - 09:13 PM Last post by: OpaQue |
|||
![]() |
16 | Triple X | 851 | 25th September 2004 - 11:17 PM Last post by: -prodigy- |
|||
![]() |
8 | spawn_syxx9 | 375 | 9th October 2004 - 07:46 PM Last post by: Becca |
|||
|
Lo-Fi Version | Time is now: 5th December 2008 - 08:36 AM |