SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Urgent help needed - unusual redirect to another page

    One of my clients has just sent out an email blast which includes a badly formed link:

    domainname.com/go/abc_ose



    Note the two
    entities on the end. This URL gives a 404 and the client has asked me to set up a redirect to another page on the same website. I've tried using a 301 redirect but that only seems to work for the part of the URL before the entities.

    How can I do this? Can it be done with modrewrite? What would I need to add to my htaccess ?

    It's nearly 10pm and I want to go to fix this before I go to bed!

    Thanks
    Last edited by wordsun; Aug 28, 2008 at 14:16.

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I cant see which 2 entities you mean.

    To get your client out of a hole because of an aberration caused by a malformed url try this:

    just make 2 folders:

    go/abc_ose

    and stick a file called index.php in it with a redirect:

    PHP Code:
    <?php
    header
    ("Location: /newpage.php");
    exit();
    ?>

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Nice work Cups, there was me working out a .htaccess and you come along with a perfect example of KISS.

    *tips his imaginary hat*

    SilverB.

  4. #4
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys - unfortunately the forum truncated the URL I had put and removed the entities Basically the URL ended with & # 10 ; (I have added spaces to avoid it being removed again).

    Anyway, the problem is now solved by creating a redirect on
    domainname.com/go/abc_ose& breaking it at the # which has been interpretd as an anchor.

    Thanks very much for your help.

    Michael

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    @SilverBulletUk

    Thanks Old habits die hard.

    Its a habit I got into when trying to rid myself of odd recurring lines in error_log files for dumb spiders that refused to obey 301s and 302s and didn't read robots.txt and kept polling for pages I withdrew years ago. (gigabot, I'm looking at you)

    That, and my knowledge of http is very shaky.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •