yeehawjared Posted December 20, 2006 Share Posted December 20, 2006 I'm building a site similar to www.ultimate-guitar.com. Let's digest a sample URL from their site:http://www.ultimate-guitar.com/tabs/[color=green]l[/color]/[color=blue]led_zeppelin[/color]/[color=red]stairway_to_heaven[/color][color=orange]_ver4_[/color][color=teal]tab[/color][b].htm[/b]I can assume the variables getting passed are something like:[color=green]?artistLetter=l[/color][color=blue]?artist=led_zeppelin[/color][color=red]?title=stairway_to_heaven[/color][color=orange]?version=_ver4[/color][color=teal]?type=_tab[/color][b].htm[/b]I can emulate this via mod_rewrite up to the point where they have "[color=red]stairway_to_heaven[/color][color=orange]_ver4_[/color][color=teal]tab[/color][b].htm[/b]" I don't understand how they are keeping these variables separate without something like a / (forward slash) between them. I also don't know how they tack on a .htm on the end of every URLhere is my .htaccess file (note: I don't care about separating out the artistLetter as ultimate-guitar has done. root.php figures out what do do with the variables)<IfModule mod_rewrite.c>RewriteEngine onRewriteRule ^([^/\.]+)/?$ root.php?artist=$1 [L]RewriteRule ^([^/\.]+)/([^/\.]+)/?$ root.php?artist=$1&title=$2 [L]</IfModule>does anyone know how to generate this fake URL and retrieve the variables inside it ([color=red]title[/color], [color=orange]version[/color], and [color=teal]type[/color]) while adding a .htm at the end?Many thanks guys :) Link to comment https://forums.phpfreaks.com/topic/31321-is-there-a-way-to-fake-a-htm-extension-at-the-end-of-every-url-on-my-site/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.