At the moment i have a website where bands can join and there url is something like this www.example.com/band.php?name=band name.
I would like to know how i can make it so you can type www.example.com/band/bandname
Thanks for any help
At the moment i have a website where bands can join and there url is something like this www.example.com/band.php?name=band name.
I would like to know how i can make it so you can type www.example.com/band/bandname
Thanks for any help
RewriteRule ^band/(.*)$ /band.php?name=$1 [L]
If you want to know more about rewriting check out these:
http://www.addedbytes.com/apache/url-rewriting-for-beginners/
http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/
Thanks i've solved this problem
I've got another now though, i have it so that it redirects to band/bandname but on those pages it doesn't load the style sheet or images beacause it is looking in the band/ directory but that doesn't actually exist.
How can i prevent redirection of the images and css and js files?
rockinrimmer wrote:How can i prevent redirection of the images and css and js files?
Two options I can think of:
Use absolute paths in your HTML document to explicitly state the path to these files regardless of what URL was used to access the page.
Add the R flag to your RewriteRule to force an external redirect to the new location.