Current time: 04-24-2014, 03:09 PM Hello There, Guest! (LoginRegister)

Post Reply 
How do i do a redirection please?
01-16-2007, 04:53 PM
Post: #1
How do i do a redirection please?
i want that when someone click on http://www.mywebsite.com/page1.html

he will be redirected to http://www.mywebsite2.com/page1.html
i mean from page1 or website1 to page1 of website2

thanks
Find all posts by this user
Quote this message in a reply
01-16-2007, 04:59 PM
Post: #2
How do i do a redirection please?
Create a file called .htaccess (note the period) that contains the following:

Code:
Redirect permanent /page1.html http://mywebsite2.com/page1.html
Put that in the web root directory of http://mywebsite.com/ and it will automatically redirect page1.html of that site to the page1.html of the new site.

--------
Simon's website
Save $100 on 1-year plans with promo code SCJESSEY100 (details)
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2007, 05:16 PM
Post: #3
How do i do a redirection please?
thanks it works like charm Smile!
Find all posts by this user
Quote this message in a reply
01-16-2007, 05:54 PM
Post: #4
How do i do a redirection please?
hi scjessey.

I guess it is faster to modify the htaccess than to use javascript. Is that correct?

Save $97 (max discount) on dreamhost plans by using promo code: 97CRAZY.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2007, 05:58 PM
Post: #5
How do i do a redirection please?
Should be faster as the request will never actually render anything from page1.html but be redirected by Apache.

This also means that you don't need to keep anything other than .htaccess on disk. You don't need a page1.html to do the javascript redirection.

Wholly
Find all posts by this user
Quote this message in a reply
01-16-2007, 05:59 PM
Post: #6
How do i do a redirection please?
Quote:I guess it is faster to modify the htaccess than to use javascript. Is that correct?
Using .htaccess is much faster. Using JavaScript is a complete no-no. You should never use JavaScript for anything like that.

--------
Simon's website
Save $100 on 1-year plans with promo code SCJESSEY100 (details)
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2007, 06:05 PM
Post: #7
How do i do a redirection please?
thanks for the clarification rlparker and scjessey.

I used to use PHP Header function to redirect. I learnt something new today Tongue

Save $97 (max discount) on dreamhost plans by using promo code: 97CRAZY.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-16-2007, 06:39 PM
Post: #8
How do i do a redirection please?
I learn something new here every day! But you should thank *wholly* and scjessey - I sat this one out! Wink

--rlparker
Find all posts by this user
Quote this message in a reply
01-16-2007, 07:40 PM
Post: #9
How do i do a redirection please?
hahaha.

sorry sorry. yep. thanks wholly and scjessey.

and I've seen a lot of posts from you rlparker. I also learnt a lot from you Tongue

I'm still new to DH. I signed up an account last Dec. Since then, I'm always hanging around in this forum. I do remember some of the people's names. mark, wholly, rlparker... etc. You guys are great.

Save $97 (max discount) on dreamhost plans by using promo code: 97CRAZY.
Visit this user's website Find all posts by this user
Quote this message in a reply
01-17-2007, 06:41 AM
Post: #10
How do i do a redirection please?
Just to further clarify what I meant - there is nothing wrong with using JavaScript or PHP to perform a redirection (after some conditional logic, for example), it's just that in this instance neither one of those methods is appropriate.

--------
Simon's website
Save $100 on 1-year plans with promo code SCJESSEY100 (details)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: