URGENT redirect question php.?sid=1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • halyfax
    Senior Member
    • Mar 2004
    • 124

    URGENT redirect question php.?sid=1

    I want to redirect a subdirectory1/index.html file

    to

    subdirectory2/index.php?sid=1

    I cannot get this to work using the cpanel's redirect method.

    How do I achieve this to redirect automatically?

    TIA
  • Elite
    Senior Member
    • Apr 2004
    • 168

    #2
    Code:
    Redirect /subdirectory1/index.html [url]http://yoursite.com/subdirectory2/index.php?sid=1[/url]
    In a .htaccess file in the subdirectory1 directory might do it

    Comment

    • halyfax
      Senior Member
      • Mar 2004
      • 124

      #3
      Originally posted by Elite
      Code:
      Redirect /subdirectory1/index.html [url]http://yoursite.com/subdirectory2/index.php?sid=1[/url]
      In a .htaccess file in the subdirectory1 directory might do it

      isn't this what the cpanel tries to create? I think because it has the .php?sid=1 the .htaccess file doesn't work

      p.

      Comment

      • halyfax
        Senior Member
        • Mar 2004
        • 124

        #4
        Code:
        <?php
        header( 'Location: http://website.com/dir2/index.php?sid=1' ) ;
        ?>
        Placing this at the very top an index.php file in dir1 seems to do the trick on all browsers

        Comment

        • Elite
          Senior Member
          • Apr 2004
          • 168

          #5
          Originally posted by halyfax
          isn't this what the cpanel tries to create? I think because it has the .php?sid=1 the .htaccess file doesn't work

          p.
          Not sure - I don't use the auto cpanel stuff, but just tried the above and it works for me

          Comment

          Working...