imarockstar Posted June 5, 2009 Share Posted June 5, 2009 does this look correct .. its not working and its the only thing in my htacces file RewriteEngine on RewriteRule ^display_band/([^/\.]+)/?$ display_band.php?band=$1 [L] and this is the url I am working with : http://www.tourzag.com/display_band.php?band=53 Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/ Share on other sites More sharing options...
gevans Posted June 5, 2009 Share Posted June 5, 2009 If you want to ensure you only get numbers in the second part of the URI try the following; RewriteRule ^display_band/([0-9]+)/$ display_band.php?band=$1 [L] This will rewrite http://www.tourzag.com/display_band/53/ to http://www.tourzag.com/display_band.php?band=53 Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850077 Share on other sites More sharing options...
imarockstar Posted June 5, 2009 Author Share Posted June 5, 2009 Actuallly I want to do the opposite .. i want to rewrite ... http://www.tourzag.com/display_band.php?band=53 to http://www.tourzag.com/display_band/53/ Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850079 Share on other sites More sharing options...
gevans Posted June 5, 2009 Share Posted June 5, 2009 Ok, confused. With the script I just gave you, you'll see; http://www.tourzag.com/display_band/53/ in the browser, and it will run; http://www.tourzag.com/display_band.php?band=53 on the server Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850083 Share on other sites More sharing options...
imarockstar Posted June 5, 2009 Author Share Posted June 5, 2009 oh i think i am confused on how this works ... so i will have to go change all my links in the code to .. http://www.tourzag.com/display_band/53/ replacing the 53 with whatever variable that it is ? Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850138 Share on other sites More sharing options...
imarockstar Posted June 5, 2009 Author Share Posted June 5, 2009 ok that works like you said .. but now my style sheets are all fucked up .. like there is no styles at all .. b Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850141 Share on other sites More sharing options...
gevans Posted June 5, 2009 Share Posted June 5, 2009 take a look at base href html tag Quote Link to comment https://forums.phpfreaks.com/topic/161088-mod-rewrite-help/#findComment-850149 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.