Wikipedia's tricks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cheesecaker
    New Member
    • Feb 2007
    • 66

    Wikipedia's tricks

    When you go to http://en.wikipedia.or g/wiki/j43i03j9f304j9f 3049j, it actually performs a search for "j43i03j9f304j9 f3049j". How is that achieved? It sort of redirects to the page whose name best matches the /blahblahblah. Does that make sense?
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Originally posted by cheesecaker
    When you go to http://en.wikipedia.org/wiki/j43i03j9f304j9f3049j, it actually performs a search for "j43i03j9f304j9 f3049j". How is that achieved? It sort of redirects to the page whose name best matches the /blahblahblah. Does that make sense?
    Hi,

    I really can't say for certain but it could be some sort of query string like processing. See if there is anything after the URL finishes (final /)and then load that into a SQL statement to query the database.

    That's a guess. Why do you want to know? Do you need to do something similar?

    Cheers
    nathj

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Originally posted by cheesecaker
      When you go to http://en.wikipedia.or g/wiki/j43i03j9f304j9f 3049j, it actually performs a search for "j43i03j9f304j9 f3049j". How is that achieved? It sort of redirects to the page whose name best matches the /blahblahblah. Does that make sense?
      The way this is done is through Apache's mod_rewrite module. This allows URL requests to be rewritten on the fly, as they are received. Behind the scenes there is likely a file called search.php, and http://en.wikipedia.or g/wiki/j43i03j9f304j9f 3049j gets rewritten as http://en.wikipedia.or g/search.php?q=j4 3i03j9f304j9f30 49j

      Comment

      • cheesecaker
        New Member
        • Feb 2007
        • 66

        #4
        Ahh, okay. Basically what I want to do is what freedomain.co.n r does, except with my own domain. They give you a subdomain, such as mydomain.co.nr. Then when you go that url, it displays a frame that loads the site you point the freedomain to at the freedomain.co.n r control panel. Only downside is, you have to use their .co.nr subdomains. I want to do it with my own domain, since I'm hosting myself with a blocked port 80. I've gotten it to work with the index.html file. I host the actual domain on a free host, and on the index.html it just loads a single frame, sourced at ServerIP:8080. So if I go to mydomain.com, the frame loads index.html, where the frame is sourced at serverip:8080. But if I were to go to mydomain.com/subdirectory, I'd need the frame to be sourced at serverip:8080/subdirectory. It's a very confusing explanation, but that's what I need.

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          Originally posted by cheesecaker
          Ahh, okay. Basically what I want to do is what freedomain.co.n r does, except with my own domain. They give you a subdomain, such as mydomain.co.nr. Then when you go that url, it displays a frame that loads the site you point the freedomain to at the freedomain.co.n r control panel. Only downside is, you have to use their .co.nr subdomains. I want to do it with my own domain, since I'm hosting myself with a blocked port 80. I've gotten it to work with the index.html file. I host the actual domain on a free host, and on the index.html it just loads a single frame, sourced at ServerIP:8080. So if I go to mydomain.com, the frame loads index.html, where the frame is sourced at serverip:8080. But if I were to go to mydomain.com/subdirectory, I'd need the frame to be sourced at serverip:8080/subdirectory. It's a very confusing explanation, but that's what I need.
          Yeah, see, that's a problem. In order for the redirect to happen, you need to hit the page to begin with.
          Some domain registration services (I know Yahoo does) allow you to set up a "webhop," which is pretty much exactly what you are asking for. Not all domain registrants will do this though, but you can find services like DynDNS which will do it as well.

          Comment

          • cheesecaker
            New Member
            • Feb 2007
            • 66

            #6
            Originally posted by Motoma
            Yeah, see, that's a problem. In order for the redirect to happen, you need to hit the page to begin with.
            Some domain registration services (I know Yahoo does) allow you to set up a "webhop," which is pretty much exactly what you are asking for. Not all domain registrants will do this though, but you can find services like DynDNS which will do it as well.
            Exactly, but I've gotten around that by hosting my proper .com domain on a free host, with no ads or frames or anything. Just regular hosting, with one index.html file. I'm hoping to figure out a setup where going to a subdirectory on this proper-hosted domain's index.html's frame to source to serverIP:8080/subdirectory.

            Comment

            • Motoma
              Recognized Expert Specialist
              • Jan 2007
              • 3236

              #7
              Originally posted by cheesecaker
              Exactly, but I've gotten around that by hosting my proper .com domain on a free host, with no ads or frames or anything. Just regular hosting, with one index.html file. I'm hoping to figure out a setup where going to a subdirectory on this proper-hosted domain's index.html's frame to source to serverIP:8080/subdirectory.
              So you are just looking for the HTML for an inner frame? I will forward this thread to the HTML forum then!

              Comment

              • cheesecaker
                New Member
                • Feb 2007
                • 66

                #8
                Originally posted by Motoma
                So you are just looking for the HTML for an inner frame? I will forward this thread to the HTML forum then!
                Not necessarily html... there would probably have to be some sort of dynamic aspect, since I want the inner frame's source to automatically reflect the subdirectory that the URL is trying to access. Just to remind, mydomain.com/abc123 should show a page with a frame that automatically sources itself to ServerIP:8080/abc123.

                Comment

                • Motoma
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3236

                  #9
                  Originally posted by cheesecaker
                  Not necessarily html... there would probably have to be some sort of dynamic aspect, since I want the inner frame's source to automatically reflect the subdirectory that the URL is trying to access. Just to remind, mydomain.com/abc123 should show a page with a frame that automatically sources itself to ServerIP:8080/abc123.
                  You will need to have access to the apache configuration, or at least be able to run your own settings through a .htaccess file. If you can do the latter, take a look at mod_proxy.

                  Comment

                  • cheesecaker
                    New Member
                    • Feb 2007
                    • 66

                    #10
                    Originally posted by Motoma
                    You will need to have access to the apache configuration, or at least be able to run your own settings through a .htaccess file. If you can do the latter, take a look at mod_proxy.
                    I do run my own server, so I suppose I'll look through that.

                    Comment

                    • cheesecaker
                      New Member
                      • Feb 2007
                      • 66

                      #11
                      Originally posted by Motoma
                      You will need to have access to the apache configuration, or at least be able to run your own settings through a .htaccess file. If you can do the latter, take a look at mod_proxy.
                      Wow, thanks! I've almost achieved the effect I wanted. Last thing, though. Right now, this is in my root html folder on the free host.

                      Code:
                      ProxyRequests Off
                      
                      <Proxy *>
                      Order deny,allow
                      Allow from all
                      </Proxy>
                      
                      ProxyPass / http://<insert server IP>:8080/
                      ProxyPassReverse / http://<insert server IP>:8080/
                      This works. However, for each page, I have to make another ProxyPass and ProxyPassRevers e entry. How would I make it so it's dynamic, to just change every request to call pages from http://serverIP:8080, automatically, while still keeping the original domain.com/subdirectory URL in the address bar?. Should I just work with mod_rewrite?

                      Or could I for example do:
                      Code:
                      ProxyPass /* http://<insert server IP>:8080/*
                      ProxyPassReverse /* http://<insert server IP>:8080/*
                      And use the * as a wildcard?

                      Comment

                      • Motoma
                        Recognized Expert Specialist
                        • Jan 2007
                        • 3236

                        #12
                        Originally posted by cheesecaker
                        Wow, thanks! I've almost achieved the effect I wanted. Last thing, though. Right now, this is in my root html folder on the free host.

                        Code:
                        ProxyRequests Off
                        
                        <Proxy *>
                        Order deny,allow
                        Allow from all
                        </Proxy>
                        
                        ProxyPass / http://<insert server IP>:8080/
                        ProxyPassReverse / http://<insert server IP>:8080/
                        This works. However, for each page, I have to make another ProxyPass and ProxyPassRevers e entry. How would I make it so it's dynamic, to just change every request to call pages from http://serverIP:8080, automatically, while still keeping the original domain.com/subdirectory URL in the address bar?. Should I just work with mod_rewrite?

                        Or could I for example do:
                        Code:
                        ProxyPass /* http://<insert server IP>:8080/*
                        ProxyPassReverse /* http://<insert server IP>:8080/*
                        And use the * as a wildcard?
                        I haven't done much with mod_proxy, but reading through the documentation, it seems that you would use something like this:

                        Code:
                        ProxyRemote * http://youripaddy:8080

                        Comment

                        Working...