I’m working on an MVC framework for my company’s application and using .htaccess to get URL variables to manage routing and variables for my bootstrapper. It’s working great on my local machine running the latest flavor of Apache via WAMP…..
However, on my remote dev server (running identical versions of Apache) .htaccess appears to be ignoring requests to url.com/index/ while it still properly recognizes variables passed to other paths such as url/blog/.
Test Cases:
URL request: http://url.com/index/login/
$_REQUEST['rt']: null
URL request: http://url.com/index/blah/
$_REQUEST['rt']: null
URL request: http://url.com/blog/view
$_REQUEST['rt']: blog/view
URL request: http://url.com/red/blue/green/orange/
$_REQUEST['rt']: red/blue/green/orange/
On my WAMP instance, the first test from above returns the following:
URL request: http://url.com/index/login/
$_REQUEST['rt']: index/login
Here’s the .htaccess being used on both servers:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]
I’ve restarted the browser multiple times, cleared my brower’s cache, restarted, etc…..nothing seems to help. Any ideas why this would be the case?
I’ve found out what is the problem and how to solve it, this must be the first line of your htaccess:
Works fine for me, cheers