Greaser9780 Posted October 14, 2007 Share Posted October 14, 2007 RewriteEngine On Options +FollowSymLinks RewriteRule ^star/(.*).php /star.php?name=$1 I get no errors from this code but it doesn't actually rewrite the url. I had to manually add the module in apache. under my php.info it's showing the apache module. But I'm not sure if something should be showing under the php section or not. Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/ Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 under my php.info it's showing the apache module. That only shows that php is working with Apache. mod_rewrite is an Apache module. Did you restart Apache after adding mod_rewrite? Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369244 Share on other sites More sharing options...
trq Posted October 14, 2007 Share Posted October 14, 2007 Oh and ps: If you are getting errors they will show up in your log. /var/log/apache in a default Linux setup. Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369246 Share on other sites More sharing options...
Greaser9780 Posted October 15, 2007 Author Share Posted October 15, 2007 It's not showing an error log in that directory. When I try to do an apache rebuild, it never shows the --enable-module=rewrite in the config. Should I attempt a manual rebuild through SSH and force it to load the enable? Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369562 Share on other sites More sharing options...
trq Posted October 15, 2007 Share Posted October 15, 2007 What distro (assuming Linux) are you using? Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369752 Share on other sites More sharing options...
Greaser9780 Posted October 15, 2007 Author Share Posted October 15, 2007 After many trial and error sessions, I got sick of my site shutting down everytime I tried an Apache rebuild. I finally contacted support to get things in order. They also reinstalled my GD2 library, although under the php info where it lists how it was configured it's not showing anything to do with mod rewrite. It's running CentOS 4.5. I still have the following code in my .htacess file but it's still not actually rewriting. RewriteEngine On Options +FollowSymLinks RewriteRule ^pornstar/(.*).php /pornstar.php?name=$1 Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369766 Share on other sites More sharing options...
Greaser9780 Posted October 15, 2007 Author Share Posted October 15, 2007 Finally I figured out how I am such an idiot. All this time I thought the rewrite was supposed to change the second value in the rule to the second. After banging my head against the wall reading tutorials on this from google I ran into one that finally showed me what I was doing wrong. I also had to figure out how to escape the %20 thing for spaces with streplace. Thanks for your patience Thorpe. Quote Link to comment https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/#findComment-369849 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.