Results 1 to 4 of 4

Thread: 301 Redirect Not Working as I Expect

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    22

    Default 301 Redirect Not Working as I Expect

    I have a redirect from mydomain.com to http://www.mydomain.org. It's permanent and wildcard. Yet, the only time I see a redirect is if I go to mydoman.com or www.mydoman.com. The browser is properly redirected to http://www.mydomain.org.

    When I go to mydomain.com/file_name, it correctly serves the file from the .org account. But the browser remains and the .com and doesn't get redirected.

    I see two possible answers here: 1) I'm doing it wrong or 2) I'm misunderstanding how a redirect works. I'm guessing for number 1. Thoughts?

    Thanks!
    Mike
    NYC Caterers by Epicurean Creations

  2. #2
    Administrator AndrewT's Avatar
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    3,637

    Default

    It sounds like you're just missing an aspect to redirect any mydomain.com request (instead of just /) to mydomain.org. This can be setup in the redirects section of cPanel. If you need help with this just submit a ticket and we can take a look.

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    140

    Default

    Putting this into the .htaccess file in the site root should do the trick:

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com$
    RewriteRule ^(.*) http://mydomain.org/$1 [NC,L,R=301]

  4. #4
    Junior Member
    Join Date
    Dec 2004
    Posts
    22

    Default

    You sir, are correct! Here's what I ended up with at the beginning of my .htaccess:

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    # BEGIN redirect root to www
    # <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mikegulbin.com$ [NC]
    RewriteRule ^(.*)$ http://www.mikegulbin.com/$1 [R=301,L]
    # </IfModule>
    The other important thing to mention is that Andrew said he had to put it at the beginning, BEFORE the stuff that WordPress inserts when it gets installed.
    NYC Caterers by Epicurean Creations

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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