Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 11 of 11

This is a discussion on Redirects not working on subdomains in the Shared & Semi-Dedicated forum
Redirects on my subdomains are not working. I have Redirect permanent /subdomain/onefile.html http://www.domain.com/anotherfile.html It give a 500 server error when I type in the file ...

  1. #1
    Aletia Customer
    Join Date
    Oct 2001
    Posts
    631

    Redirects not working on subdomains

    Redirects on my subdomains are not working. I have

    Redirect permanent /subdomain/onefile.html
    http://www.domain.com/anotherfile.html

    It give a 500 server error when I type in the file name.

  2. #2
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    Hehe, I've never been able to get that to work. No biggie, imo. Subdomain redirects don't keep the subdomain name in tact in the address bar anyway, so just use a META tag redirect.

    Just put this between the <head> tags of onefile.html:

    <META HTTP-EQUIV="refresh"
    CONTENT="0;URL=http://www.domain.com/anotherfile.html">

    Problem solved

  3. #3
    Aletia Customer
    Join Date
    Oct 2001
    Posts
    631
    I have several to do, and I don't want to create new files for each one. I guess I'll have to do it this way for now, but if anyone knows a better way to do it, please let me know.

  4. #4
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    Well, it's not so much trouble as it sounds. Just create an index.html with nothing but

    <html>
    <head>
    <META HTTP-EQUIV="refresh"
    CONTENT="0;URL=http://www.domain.com/anotherfile.html">
    </head>
    </html>

    No need to even have a body if the only thing it's doing is redirecting. Just adjust the url in the index.html file as neccesary and copy it to each subdoman directory that you want to redirect from.

  5. #5
    Ron
    Guest
    how about in .htaccess

    Code:
    RewriteEngine On
    RewriteBase   /<pathtofile>  # if you're not in your docroot directory
    RewriteRule   ^somefile\.html$  anotherfile.html [R=301,L]

  6. #6
    Ron
    Guest
    Any luck?

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Originally posted by Ron
    Any luck?
    Yeah, I got lucky last night. Women! One day they want to kill you, the next day they want to eat you with a spoon.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  8. #8
    JPC Guru
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    389
    ...eat you with a spoon
    Just make sure there's no knife in her other hand
    Last edited by Galen; 03-24-2004 at 07:56 PM.

  9. #9
    Aletia Customer
    Join Date
    Oct 2001
    Posts
    631
    I tried putting the re-directs in the htaccess of the subdomain, and that didn't work either.

    How would that rewrite rule work? would I put that in the main sites .htaccess file, or the .htacess file in the subdomain?

  10. #10
    Ron
    Guest
    It needs to be in the directory where the object of the redirect lives, not just the main directory. If that doesn't *HAPPEN* to be the docroot, then you need the RewriteBase line.

    Methinks

  11. #11
    Just Walking...
    Join Date
    Oct 2002
    Location
    England
    Posts
    436
    Edit: Nevermind, late night - didn't read the original post well enough.

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
  •