So I migrated my app from one host to another. Most of the app works through 'pretty urls' where /login.php becomes /login (which I access in my php through $_SERVER['REQUEST_URI'] ), however after switching hosts my htaccess code for this doesn't work anymore (chrome gives me a redirect loop error).
This is the code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ ./index.php
Any idea what could be wrong?
RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]does? it looks completely useless to me...RewriteCond %{SERVER_PORT} ^80$= Look for any connection over port 80.RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]= Rewrite everything^(.*)$tohttp://%{SERVER_NAME}%{REQUEST_URI}and make it the[L]last rule, which is a[R]redirect. If you want to make it permanent, change [L,R] to [L,R=303] `303 is the HTTP-code for 'moved permanently'