Need a little help as I'm stuck here. Recently moved all my sites to new server. One site is giving me fits. It's a custom developed PHP site. Has .htaccess file with rules such as: Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} ^/([a-z0-9,\_]+)/details RewriteRule ^(.*) /event_details.php?event=%1 [L] The simple test page of event_details.php contains: <? $strThisEventShortName = $event; echo "short name is $event<BR>"; ?> On my NEW server this $event variable returns nothing. It's like the rewrite rules broke on the new server. mod_rewrite is installed so thats not it. Anything I'm doing wrong in this code? What would have changed from server to server? Thanks!
Thanks for the reply. Just tried that. Same result. When I go to: http://www.FAKEURL.net/test/details I expect to see "short name is test" but I see "short name is " Seems like something isn't turned on or some option is missing on this new server setup. Anyone?
Remove the RewriteCond line and replace the second line with: RewriteRule ^/([a-z0-9,\_]+)/details$ /event_details.php?event=$1 [L]
That gave me a 404 not found: Not Found The requested URL /test/details was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Really appreciate your help!
Thank you. This worked for me: RewriteRule ^([a-z0-9,\_]+)/details$ event_details.php?event=$1 [L] If I put it in a folder, say "folder", this worked: RewriteRule ^([a-z0-9,\_]+)/details$ folder/event_details.php?event=$1 [L]
I know it... It sucks because all of this works (worked) on my other server... Not on the new server for some reason. Same code... Different results. Has to be something in my apache/php install I think - but not sure what.
Check with your new host! Ask them if they are using suPHP as DSO or CGI ? From there you may have a issue if the above is true and you are switching from PHP as DSO Do they even support rewrite? Thank you Jason