#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0

    Redirecting to new page


    Hi All,
    We can redirect page by using META tags. But my question is if we want to redirect
    ww.bond.com/007/something to ww.bond.com/008/something, how can I do it? Please guide me.

    Thanks,
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,960
    Rep Power
    9397
    Your post doesn't actually have a question in it...
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Why do you think that's not possible with meta tags?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Posts
    195
    Rep Power
    45
    Originally Posted by bond.sam
    Hi All,
    We can redirect page by using META tags. But my question is if we want to redirect
    ww.bond.com/007/something to ww.bond.com/008/something, how can I do it? Please guide me.

    Thanks,
    Assuming 'something' is a php file, you can put this in:

    PHP Code:
    <?php
       header
    ('Location: 008/something.php');
    ?>
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by requinix
    Your post doesn't actually have a question in it...
    Sorry, My question is if we use META tag it redirect to new page if we hit that particular meta tag file. I am replacing all the content from one folder to another folder on server. Lets take a instance I copied all the files from folder 007 to 008. If user wants to access any of the file under 007 folder it has to redirect to that particular file under 008. In generalize .com/007/anything has to redirect to .com/008/anything.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by ManiacDan
    Why do you think that's not possible with meta tags?
    There are so many files under 007 folder. We have to use metatag for each file to redirect to same page under 008.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by BlackAce
    Assuming 'something' is a php file, you can put this in:

    PHP Code:
    <?php
       header
    ('Location: 008/something.php');
    ?>
    I want to be done it dynamically. something is dynamic. There are so many possibilities of something.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2010
    Posts
    195
    Rep Power
    45
    Originally Posted by bond.sam
    I want to be done it dynamically. something is dynamic. There are so many possibilities of something.
    OK, so how about this:

    PHP Code:
    <?php
    $page 
    $_SERVER["REQUEST_URI"];
    $new_dir "008";

    header('Location: '.$new_dir.$page);
    ?>
    If it were me, I'd do it as an include at the top of all of your old pages, that way if you want to tweak it, you can just change one file and not have to update all of the old files again one by one.
  16. #9
  17. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    You have thousands of individual files which don't share any common code? Problems like this were very very common...back when server-side programming languages were invented.

    You can try to enter a rewrite rule at the server level, but you're probably better off just doing it by hand.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by ManiacDan
    You have thousands of individual files which don't share any common code? Problems like this were very very common...back when server-side programming languages were invented.

    You can try to enter a rewrite rule at the server level, but you're probably better off just doing it by hand.
    Could you please help me by explaining the solution?
  20. #11
  21. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Open file 1. Put a redirect in. Save. Close. Repeat for files 2-10,000.

    If there's no shared code, you can't make a single change to fix it.

    There are two decent solutions which require that you have access to the server configurations and can control server-level URL handling and 404 pages. Do you have that ability?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by ManiacDan
    Open file 1. Put a redirect in. Save. Close. Repeat for files 2-10,000.

    If there's no shared code, you can't make a single change to fix it.

    There are two decent solutions which require that you have access to the server configurations and can control server-level URL handling and 404 pages. Do you have that ability?
    I know the first option but I have to repeat same process for all the files and that too if there are any parameters if any file thats difficult to handle.

    I have an access to server configuration files. So can you guide me in other way instead of hard coding all the files.
  24. #13
  25. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    That depends. What kind of server is it? If it's apache, you can use mod_rewrite to rewrite any URLs to one folder to a specific target.

    Other servers have similar functionality, but the type of server is what matters.

    You can also set up a custom 404 handler, then DELETE (or move) the old files. Your 404 handler will be hit, and redirect people to the one URL you want.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    7
    Rep Power
    0
    Originally Posted by ManiacDan
    That depends. What kind of server is it? If it's apache, you can use mod_rewrite to rewrite any URLs to one folder to a specific target.

    Other servers have similar functionality, but the type of server is what matters.

    You can also set up a custom 404 handler, then DELETE (or move) the old files. Your 404 handler will be hit, and redirect people to the one URL you want.
    Its Apache server.

IMN logo majestic logo threadwatch logo seochat tools logo