Jump to content

[SOLVED] Can't get mod rewrite to work


Greaser9780

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/73195-solved-cant-get-mod-rewrite-to-work/
Share on other sites

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 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.