Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts

    .htaccess redirect error

    Hi, every time i use

    Code:
    # This allows you to redirect your entire website to any other domain
    Redirect 301 / 360-tactics.co.uk/forum/index.php
    in my .htaccess it redirects my website from 360-tactics.co.uk to "http://360-tactics.co.uk/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/forum/index.php/"

    why is it doing this, its causing an error.

    please help.

    Cheers
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    You need the fully qualified URL, including the scheme (most likely http://)... otherwise it is treated as relative and will trap itself in an infinite redirect loop:
    Code:
    Redirect 301 / http://360-tactics.co.uk/forum/index.php
    Last edited by kbluhm; 11-18-2011 at 03:05 PM.

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Location
    Kent, UK
    Posts
    573
    Thanks
    23
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by kbluhm View Post
    You need the fully qualified URL, including the scheme (most likely http://)... otherwise it is treated as relative and will trap itself in an infinite redirect loop:
    Code:
    Redirect 301 / http://360-tactics.co.uk/forum/index.php
    after doing this i am still getting the error :s
    http://360-tactics.co.uk/forum/index.php

    Crime-Wave

    please post your code wrapped in tags
    please post your PHP wrapped in tags

  • #4
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Oh, I misread the error.

    Is the redirected URL on the same site as the new URL? If so, when you load:
    Code:
    http://360-tactics.co.uk/forum/index.php
    The .htaccess rule is always telling it to take the root `/` and redirect.

    Give this a shot:
    Code:
    RedirectMatch ^/$ http://360-tactics.co.uk/forum/
    That should only redirect if the requested URI is `/`, or empty.

    Otherwise, you could always strike that from the .htaccess file and edit your root index file :P
    PHP Code:
    <?php header'Location: /forum/'TRUE301 );
    Last edited by kbluhm; 11-18-2011 at 03:43 PM.


  •  

    Posting Permissions

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