Hi - I am a travel photographer as well as a php/mysql web developer. I have a number of images with Getty, and was interested to see that when displaying one of my images, they use a directory name based on the image title, then the image id number in the web URL, presumably for SEO ranking purposes. URL example: http://www.gettyimages.com/detail/photo/london-underground-tube-sign-outside-big-high-res-stock-photography/148624493 They obviously don't have a separate directory for each of their milllions of images, so I assume the middle named directory is a dummy, created on the fly, and bypassed on the fly when the viewer wants to see the '148624493' image. My question: how is this done, and could I do something similar on my own php/mysql site? Any tips, hints, guides or links to descriptions or tutorials will be much appreciated. I have done a lot of searching but come up with nothing useful so far. Regards, Tim Makins, currently travelling in Laos. http://www.gnomeplanet.com/gallery.php
That is done with the help of htaccess file on Apache. You can probably set up a wordpress blog for this purpose if you dont want to spend too much time on this. I can offer paid help to do the same, if you need any assistance. PM me if interested.
Changes are the actual file your accessing in that link is something like www.gettyimages.com/detail.php or something like that to do it you need to learn about mod_rewrite. I only know the basics of it. In this example it will allow you to remove the .php extension in the urls. Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)\/$ $1.php [nc] PHP:
Thanks, PK-Host, for the information - that gives me plenty to work with. I have subsequently found out that this technique is called 'URL Rewriting'. A quick search for this will find plenty of useful tutorials, so anyone else who needs to do this will soon find out all of the information needed - definitely no need to pay anyone to do it for you !!! Here's something to start with: http://www.addedbytes.com/for-beginners/url-rewriting-for-beginners/ http://www.debian-administration.org/articles/136 http://httpd.apache.org/docs/2.0/misc/rewriteguide.html Tim Makins