UnknownPlayer Posted February 9, 2011 Share Posted February 9, 2011 I want to put rewrite mod on my website, and i made new file .htaccess with this code: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^game/([0-9]+)$ play.php?gid=$1 [L] Now when i go to address www.my-site.com/game/1 it works, but .css is not loaded :S styles.css file is in dir /css/, how can i make this to work ? Quote Link to comment https://forums.phpfreaks.com/topic/227152-mod_rewrite-not-working/ Share on other sites More sharing options...
devknob Posted February 9, 2011 Share Posted February 9, 2011 hardlink to your css http://yoursite/css/cssfile.css just assuming you're using relative paths. Quote Link to comment https://forums.phpfreaks.com/topic/227152-mod_rewrite-not-working/#findComment-1171985 Share on other sites More sharing options...
UnknownPlayer Posted February 10, 2011 Author Share Posted February 10, 2011 Hmm, what do you mean, how to do that? Quote Link to comment https://forums.phpfreaks.com/topic/227152-mod_rewrite-not-working/#findComment-1172303 Share on other sites More sharing options...
Jessica Posted February 12, 2011 Share Posted February 12, 2011 When I do this, I check my URL in my base file (which is your play.php) and check the first part. If it's css, js, or any other of a list I define, I then include the file I want (the .css file), instead of doing my normal base output. So this goes near the top of your base file. Quote Link to comment https://forums.phpfreaks.com/topic/227152-mod_rewrite-not-working/#findComment-1173362 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.