mod_rewrite troubles
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
mod_rewrite is working fine and it's enabled, but the page content isn't being displayed properly.
I have another VPS that I decided to upload these files to and test, and when I goto something like example.com/real/page (on the other VPS, different host), it returns correctly on my other VPS with the same code and rewrite. But when I do that on my linode, it just keeps giving me the content from index.php and not the /real/page.
Any ideas what settings I should be looking for that might cause that? The other VPS is a managed one, so I don't really know everything it has.
If you need additional information let me know.
3 Replies
@Nibbler:
If it's an old app then it might require register globals to be enabled in php. Try enabling that in your php.ini and see if that helps.
http://php.net/manual/en/security.globals.php
Nope, didn't fix it :/
Incase this helps anyone:
The server it works on is running: Apache v2.2.17 on CentOS, PHP v5.2.16
My linode is running on: Apache v2.2.14 on Ubuntu 10.04, PHP v5.3.2
I have Ubuntu 11.04 installation with PHP MyAdmin (working fine) and Apache2. No mail or any extras. The static site comes up, but when I put up a cakephp site, I get a 404 "The requested URL was not found on this server." mod_rewrite is enabled, apache was restarted. The .htaccess files are all there, confirmed and correct. The site works locally, it works on cheapo shared host, but somewhere in the apache2 installation is the magic key that I can't find.
I'd appreciate any help. Hope the original poster finds a solution as well.