I am using the ForceType method outlined on this site however I can't get it to work, I just get directory not found, can anyone help? Im running xampp for linux.
I am using the ForceType method outlined on this site however I can't get it to work, I just get directory not found, can anyone help? Im running xampp for linux.
Did you do the test?
Open up a regular php file and see if you can access REQUEST_URI.
Also, is this your server or a shared host? It is possible your host turned off this apache feature.
I put the following:
in a php file and I got the URI.PHP Code:
<?php
echo $_SERVER["REQUEST_URI"];
?>
I really dislike force-type - just because dicking with the mime-type is just making things more complicated to me.
I use mod-rewrite, but I use a different appraoch than the one outlined on this site...
Basically the above tells the server to reroute all requests EXCEPT files with those extensions to my index.php, from which I handle all operations. You then just explode REQUEST_URI since that does NOT change on a mod-rewrite.Code:RewriteEngine On RewriteRule !\.(gif|jpg|png|css|swf|html|js|ico|xml)$ index.php
You'll also see I do NOT allow php file requests to be made, redirecting those to index.php - this is a primative security feature of sorts since it prevents apache from allowing users to call any of your libraries independantly.
I do the same as mentioned previously... except I do it like this. Which I believe is how WordPress "SEO Friendly URLS" works too.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Not only does it let me pass it all to my index file I can change up my URL structure on the fly as I have an option to set new structure too.
Bookmarks