| | #1 |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
I need help in how to get a URL redirected to an external website but keeping the link of my own site (of that external link). Let me explain it a little: My Site link I need to redirect: www.mysitelink.com/external External Site that should open when above link is clicked: www.externalsitelink.com Now when someone clicks on mysitelink.com/external, I need to redirect the page to www.externalsitelink.com (to a new site). How can I do it? Thanks, |
| |
| | #2 |
| Active Warrior War Room Member Join Date: 2011 Location: Wheaton, IL
Posts: 91
Thanks: 10
Thanked 10 Times in 7 Posts
|
Well, There's a couple of ways to do this. You can always "cheat" and display the link text as www.mysitelink.com/external, but really it will point to www.externalsitelink.com. Here's the HTML code to do this: <a href="www.externalsitelink.com">www.mysitelink.com/external</a> The other way to do this is if the "external" part of your URL is a directory, then create an index.html file inside that directory with the following content: <html> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.externalsitelink.com"> </head> </html> |
| | |
| |
| | #3 |
| HyperActive Warrior Join Date: 2010
Posts: 125
Thanks: 0
Thanked 17 Times in 16 Posts
|
If you want to keep that original link you can use a frame redirect script. <HTML><HEAD> </HEAD> <FRAMESET border=0 rows="100%,*" frameborder="no" marginleft=0 margintop=0 marginright=0 marginbottom=0> <frame src="http:/www.externalsitelink.com" scrolling=auto frameborder="no" border=0 noresize> <frame topmargin="0" marginwidth=0 scrolling=no marginheight=0 frameborder="no" border=0 noresize> </FRAMESET> </HTML> |
| | |
| |
| | #4 |
| SQLMgmt.com Join Date: 2011 Location: Seattle
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
If you're using ASP.NET, one simple way of doing it is create default.aspx under external folder and in the Page_Load event handler, redirect the URL: Page_Load() { Response.Redirect("external_site_name_here"); } |
| |
| | #5 |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
Thanks for all the replies guys. @maxmalini: About the second method, should I add the directory to the EXTERNAL site? Because I don't have any authority/access to the external site and I only want to add links within my site to be redirected to the external site. Thanks @jade69: Please tell me, I have a bunch of links that I want to redirect; so can I add all of them in the same iframe method; you mentioned? And is it search engine friendly? Thanks I've seen a site similar to what I require (URL functionality): web hosting geeks . com (remove spaces) There, you can mouse-over the first link; InMotion. It is redirecting to Business Web Hosting | InMotion Hosting. But the link on the geeks page is actually different than the landing page. That is the same redirect method I need. Thanks |
| |
| | #6 | |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
Please clear, can using redirection for so many URLS to different external sites cause any problem; from both; hosting point of view (as I am using shared hosting) and from SEO point of view? Regards, | |
| |
| | #7 | |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 471
Thanks: 30
Thanked 234 Times in 34 Posts
|
| |
| | ||
| |
| | #8 | |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
But wouldn't it be a problem in case user's browser is not supported (disabled javascript). | |
| |
| | #9 |
| Limitless Ambition War Room Member Join Date: 2011
Posts: 249
Thanks: 27
Thanked 39 Times in 23 Posts
|
Create the following file in the external directory: index.php The code of that file should be: Code: <?
header("Location: http://whateveryouwantyourexternalsitetobe.com");
?> There is no problems with hosting or SEO by doing this. Most sites link out, and using an internal link to do a 301 redirect is not harmful at all. Hope that helps! |
| |
| | #10 | |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
When you say "Create the following file in the external directory: index.php", what do you mean by "external directory"? | |
| |
| | #11 | |
| HyperActive Warrior War Room Member Join Date: 2011
Posts: 129
Thanks: 2
Thanked 13 Times in 12 Posts
|
However, it is impossible for you to just use scripts like he said. Javascript is NOT able to change the url of your web browser as that would cause a major security issue. | |
| | ||
| |
| | #12 |
| Warrior Member Join Date: 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi, I would use as well the htaccess method. Yes, you can add as many redirections as you like in the htaccess. The advantage in compare with the folder method (and index.html or index.php) is that you have to edit 1 file, when there are changes somewhen. And your file structure is not growing like hell in case you have 100 external links. |
|
Automate your SEO controlling and save a lot of time with Serp & SEO Monitor. Just a few features of that great SEO Software are automated keyword ranking check, automated backlink check (if your backlink still exists on the page of your link swap partner), personalized reports, long-term analysing with graphs and many more.
| |
| |
| | #13 | |
| HyperActive Warrior War Room Member Join Date: 2010
Posts: 168
Thanks: 29
Thanked 12 Times in 12 Posts
|
One more thing please (relevant to my thread), the code/method you told me, is this SEO friendly? I mean, creating so many blank/redirection pages? Will Google take it as a SPAM or does Google understands this method already? Sorry for newbie question; but the fact is; I am still a newbie when it comes to programming. Thanks, | |
| |
| | #14 |
| Spa Uniforms Join Date: 2011 Location: Dandenong
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
If your site is based on .net platform then idon't know how to do 301 permanent redirection. But If your site is based on php platform then you can do 301 permanent redirection with the help of .htaccess file.
|
| | |
| |
| | #15 | |
| HyperActive Warrior Join Date: 2010 Location: USA
Posts: 449
Thanks: 2
Thanked 36 Times in 31 Posts
|
301 Permanent Redirect | |
| |
| | #16 |
| Warrior Member Join Date: 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
Yes -- it would be helpful knowing what platform you are working in as many of the tools to help you are very different. However, with that said both platforms use .htaccess -- on .NET I would recommend using Helicon ISAPI. It is basically a ISAPI filter that allows your HTACCESS file to be checked before calling IIS. Good luck.
|
| |
| | #17 | |
| Limitless Ambition War Room Member Join Date: 2011
Posts: 249
Thanks: 27
Thanked 39 Times in 23 Posts
|
If you are linking to www.mysitelink.com/external then you want to create the index.php file in this directory: /home/yoursite/public_html/external | |
| |
| | #18 |
| Warrior Member Join Date: 2011
Posts: 27
Thanks: 0
Thanked 1 Time in 1 Post
|
Just use the 301 redirect method...
|
| |
| | #19 |
| Active Warrior Join Date: 2009
Posts: 46
Thanks: 8
Thanked 2 Times in 2 Posts
|
or you can always do a dns redirect at your domain DNS settings
|
| |
| | #20 |
| HyperActive Warrior Join Date: 2011 Location: NY
Posts: 110
Thanks: 0
Thanked 0 Times in 0 Posts
|
Just a simple code you need to insert: <a href="www.externalsitelink.com">www.mysitelink.com/external</a> If you're using ASP.NET then create default.aspx under external folder and in the Page_Load event handler, redirect the URL: Page_Load() { Response.Redirect("external_site_name_here"); } |
| Webmaster Studio -A premier web design and internet marketing company in New York. | |
| |
| | #21 |
| Senior Web Developer War Room Member Join Date: 2011 Location: Quebec, Canada
Posts: 113
Thanks: 32
Thanked 19 Times in 17 Posts
|
<? header("Location: http://mynewsite.com"); ?>
|
| |
|
| Bookmarks |
| Tags |
| question, redirect, url |
| |