Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
What is the best way to redirect a web page or website?

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: What is the best way to redirect a web page or website? Reply with quote

So, what is the best way to redirect an existing website or a single web page for that matter? I am looking for somethng that would also help redirect the current web page's google pr with the page redirect. Any clue as to what approach to follow. As I heard, the javascript redirect is not reliable and search engine friendly at all.
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Sat Aug 07, 04 6:27 am
Back to top
emm View user's profile Send private message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: php, asp, htaccess 301 page redirect most efficient way Reply with quote

You are right javascript redirects are not a good option to redirect your web page or web site when you move a document or move to a new domain. It's not search engine or google friendly for one thing. For another, Javascript is very unreliable. About 10% of the surfers browse the internet turning their javascript off. For those javascript redirect won't work. The php or asp option is more reliable in this sense,

php:
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: [http://www.domain.com]" );

asp:
Response.Status = "301 Moved Permanently"
Call Response.AddHeader ("Location","http://www.domain.com")
Response.End

btw, the javascript redirect is like this:
<SCRIPT>
location.href = "http://www.quantumcloud.com/"
</SCRIPT>
(this way you can redirect all your traffics to quantumcloud. :d)

And yes, google does respect a 301 redirect and will pass the page's PR accordingly.

You can perhaps, also use .htaccess on an apache server to do a domain or page redirect. I am not sure, I will look that up. If you can then perhaps, it would be the most reliable and preferable way to do this.
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Sun Aug 08, 04 6:38 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: htaccess 301 redirect Reply with quote

Ah I got it! Very quickly too. lol

Here is how you do a 301 redirect for an entire web site or domain to another domain:

Code:
RewriteEngine On
RewriteRule /* http://www.yourotherdomain.com/ [R=permanent]


This goes to the very first of your htaccess file in the root director on your apache server. Gentle smile
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Sun Aug 08, 04 6:40 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
emm
Power User
Power User


Joined: 13 Jul 2004
Posts: 310

Post Post subject: htaccess mod rewrite 301 page redirect Reply with quote

Thanks quantum. I am not sure if my host supports htaccess. That is mod-rewrite thing right? I will send an email to the support and learn how to use the htaccess feature.
_________________
“You might say reality is the result of complex negotiations between the observer and the observed. But that is simply a point of view…”
Digital Bangladesh
Mon Aug 09, 04 2:41 am
Back to top
emm View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group