Hi, I just tried implementing a mod rewrite on my website but for some reason it doesn't seem to be having any effect... I'm quite new to all this stuff (only used to html) so please bare with me... Here's the code I used: I saved this in my "public_html" as ".htaccess" and yet all my URLs are displaying exactly as they were before... Have I made some stupid mistake somewhere? Thanks in advance
The mod rewrite does not change your urls. Those need to be changed as well. The mod rewrite will only make the static urls work. You're halfway done, now just go through and hardcode your urls to change them from dynamic to static. You're not stupid - I had this same confusion when I first tried this as well.
Also, RewriteRule ^pages/guitar\-tabs/(.*)\.html$ pages/guitar-tabs/tab-category.php?category=$1 [L] RewriteRule ^pages/guitar\-tabs/(.*)/(.*)\.html$ artist-tab-list.php?category=$1&artistName=$2 [L] PHP: instead of RewriteRule ^pages/guitar\-tabs/(.*).\html$ pages/guitar-tabs/tab-category.php?category=$1 [L] RewriteRule ^pages/guitar\-tabs/(.*)/(.*).\html$ artist-tab-list.php?category=$1&artistName=$2 [L] PHP:
abuzant -> Lol - thanks for spotting that mistake. That was the stupid part I was talking about forumposters -> Thanks - I understand what the mod rewrite does now
Just a quick question - I use the following code to collect all the names of the files that have the extension ".gp3" or ".gp4" into an array. Is there a function that allows me to order the array alphabetically? $dp = openDir ("$category/$artistName"); while ($currentFile !== false){ $currentFile = readDir ($dp); $tabs [] = $currentFile; } $tabs = preg_grep ("/gp3$|gp4$/" , $tabs); PHP: