HTML Re-Direct Question

5 replies
  • WEB DESIGN
  • |
Hey guys,

For a re-direct, I've been using a file that someone gave me to use. Basically I create a "Recommends" folder and then create another folder with whatever I'm recommending and place this file in as the index.html.

For example, mysite.com/Recommends/BlueWidgets

However, I've noticed that although the re-direct works fine, it re-directs in the same window.

I would like for it to open in a new tab whenever someone clicks on one of the links.

I know it's something simple but I thought I'd ask here instead of trying to figure it out myself.

Here is the html I'm using.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />
<meta http-equiv="Refresh"
content="1; URL=DESTINATION URL HERE" />
<title>DESTINATION TITLE HERE</title>
</head>
<body>
<br />
</body>
</html>

So basically I want that the links to open in a new tab.

I would be very grateful for your help.

Thanks in advance!
#html #question #redirect
  • Profile picture of the author soffell
    Try this :

    -----
    -----
    <meta http-equiv="Refresh"
    content="1; URL=DESTINATION URL HERE" target="_blank">
    -----
    -----
    {{ DiscussionBoard.errors[891630].message }}
    • Profile picture of the author halfpoint
      Perfect!

      Thanks for that.
      {{ DiscussionBoard.errors[891707].message }}
      • Profile picture of the author halfpoint
        Ok I just had to bump this thread.

        I've noticed that none of my links are opening up in new windows anymore.

        This is exactly what I'm doing.

        I'll link to mydomain.com/recommends/product1

        Then inside the recommends folder I have a product1 folder and the index file looks like this;

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv="Content-Type"
        content="text/html; charset=iso-8859-1" />
        <meta http-equiv="Refresh"
        content="1; URL=www.domain.com" target="_blank"/>
        <title>page title</title>
        </head>
        <body>
        <br />
        </body>
        </html>

        Obviously I have the real domain and page title, however, everything else is identical.

        Can anyone of you see what could possibly be going wrong? It's annoying that it opens in the same window.
        {{ DiscussionBoard.errors[979015].message }}
        • Profile picture of the author BurgerBoy
          Originally Posted by Pat Jackson View Post

          Ok I just had to bump this thread.

          I've noticed that none of my links are opening up in new windows anymore.

          This is exactly what I'm doing.

          I'll link to mydomain.com/recommends/product1

          Then inside the recommends folder I have a product1 folder and the index file looks like this;

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type"
          content="text/html; charset=iso-8859-1" />
          <meta http-equiv="Refresh"
          content="1; URL=www.domain.com" target="_blank"/>
          <title>page title</title>
          </head>
          <body>
          <br />
          </body>
          </html>

          Obviously I have the real domain and page title, however, everything else is identical.

          Can anyone of you see what could possibly be going wrong? It's annoying that it opens in the same window.
          You're putting target="_blank" in the wrong place.

          It should not be in the refresh code. It should be on the link itself.

          mydomain.com/recommends/product1 target="_blank"

          It would also be easier to use a php redirect instead of a refresh.

          <?php
          header( 'Location: http://www.WhereYouWantTheLinkToGo' ) ;
          ?>

          That is all that would have to be on the redirect page without all of the other junk you have on it.
          Signature
          {{ DiscussionBoard.errors[979071].message }}

Trending Topics