Quick .htaccess question.. redirecting people.. help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxweekxx
    Confirmed User
    • Oct 2002
    • 6780

    #1

    Quick .htaccess question.. redirecting people.. help

    Hey guys, i would like to redirect everyone that comes to

    http://www.mysite.com to http://mysite.com

    can i do that with .htaccess?
    _________________
    I am the best
  • woj
    <&(©¿©)&>
    • Jul 2002
    • 47880

    #2
    yes, I don't feel like writing it up though, heh
    maybe someone else will do it, so here is a bump...
    Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
    Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
    Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

    Comment

    • xxweekxx
      Confirmed User
      • Oct 2002
      • 6780

      #3
      lol u suck
      _________________
      I am the best

      Comment

      • ABC-Celebs
        Confirmed User
        • Dec 2004
        • 285

        #4
        Redirect index.html http://mysite.com

        Index.html should be your default first page.
        Raffaele,
        ABC-Celebs.com

        Comment

        • fetishblog
          Confirmed User
          • Sep 2005
          • 5995

          #5
          Something like this might work.

          RewriteEngine on
          RewriteCond %{HTTP_REFERER} !^$
          RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
          RewriteRule .*$ http://yourdomain.com [R,NC]

          Fling.com doesn't steal your traffic and sales unlike some other dating companies. I promote them, and so should you!

          Comment

          • xxweekxx
            Confirmed User
            • Oct 2002
            • 6780

            #6
            that wont work..

            bcuz IM TRYING TO redirect http://www.mysite.com/index.html to
            http://mysite.com/index.html


            wont work..
            _________________
            I am the best

            Comment

            • ABC-Celebs
              Confirmed User
              • Dec 2004
              • 285

              #7
              Originally posted by xxweekxx
              that wont work..

              bcuz IM TRYING TO redirect http://www.mysite.com/index.html to
              http://mysite.com/index.html


              wont work..
              Have you tried
              Redirect index.html http://mysite.com/index.html ?
              Raffaele,
              ABC-Celebs.com

              Comment

              • xxweekxx
                Confirmed User
                • Oct 2002
                • 6780

                #8
                Originally posted by fetishblog
                Something like this might work.

                RewriteEngine on
                RewriteCond %{HTTP_REFERER} !^$
                RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
                RewriteRule .*$ http://yourdomain.com [R,NC]


                didnt work
                _________________
                I am the best

                Comment

                • xxweekxx
                  Confirmed User
                  • Oct 2002
                  • 6780

                  #9
                  Originally posted by ABC-Celebs
                  Have you tried
                  Redirect index.html http://mysite.com/index.html ?
                  didnt work just made it go crazy, dont forget the index.html in www.mysite.com is the same index.html on mysite.com/index.hml

                  so it just kept refreshing from one to other non stop
                  _________________
                  I am the best

                  Comment

                  • Scotty.T
                    Confirmed User
                    • Nov 2004
                    • 1062

                    #10
                    RewriteCond %{HTTP_HOST} ^yourdomain.com$
                    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]

                    Works for me.

                    Sorry. Just realised it was the other way you want to go. Not sure of the exact syntax for that.
                    Last edited by Scotty.T; 12-05-2005, 05:45 AM.
                    .

                    Comment

                    • Tempest
                      Too lazy to set a custom title
                      • May 2004
                      • 10217

                      #11
                      Usually people want to do it the other way around... Got code to do that, but not what you're asking for..

                      Comment

                      • xxweekxx
                        Confirmed User
                        • Oct 2002
                        • 6780

                        #12
                        hmmwont work for me
                        _________________
                        I am the best

                        Comment

                        • mkx
                          Confirmed User
                          • Nov 2003
                          • 4001

                          #13
                          i think it is your dns configuration from your domain name registrar. Make sure that * is going to the same as www, hard to explain off hand, what registar are you using?

                          Comment

                          • mkx
                            Confirmed User
                            • Nov 2003
                            • 4001

                            #14
                            oh nevermind, thought it was the other way around

                            Comment

                            • xxweekxx
                              Confirmed User
                              • Oct 2002
                              • 6780

                              #15
                              yea,

                              what im trying to do is foward everyone that hits


                              http://www.mysite.com to http://mysite.com

                              wow nobody knows this on gfy?
                              _________________
                              I am the best

                              Comment

                              • ABC-Celebs
                                Confirmed User
                                • Dec 2004
                                • 285

                                #16
                                mmm...so strange!
                                Try

                                RewriteEngine on
                                RewriteCond %{HTTP_HOST} ^www.mydomain.com [NC]
                                RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]
                                Raffaele,
                                ABC-Celebs.com

                                Comment

                                • xxweekxx
                                  Confirmed User
                                  • Oct 2002
                                  • 6780

                                  #17
                                  that worked! thanks man
                                  _________________
                                  I am the best

                                  Comment

                                  • ABC-Celebs
                                    Confirmed User
                                    • Dec 2004
                                    • 285

                                    #18
                                    Originally posted by xxweekxx
                                    that worked! thanks man

                                    np
                                    Raffaele,
                                    ABC-Celebs.com

                                    Comment

                                    Working...