User Friendly URLS

software development


So, i’ve been trying to convert my site to use the so called “user-friendly URLS” (URLS without any extensions or any visible queries ?=& etc). I came across a few sites that showed how to achieve this by using apache’s ForceType directive like this.

<Files ~ ^(id|browse|tags|admintags|submitid|info)$>
ForceType application/x-httpd-php

This seems to do the trick but now my php scripts are running via the apache module rather than cgi. This is a problem with some of my scripts where I need write access to some of my files.
Is there any alternative to using the apache forcetype directive.


That’s a terrible way to do this. Look into using mod_rewrite instead. I’ve never even heard of using ForceType for this.

If you want useful replies, ask smart questions.


Yeah, i thought mod rewrite would be a better way to do this. You’ve never heard of using forectype for this? Google user-friendly urls. There are numerous sites that explain how to use this very method. What’s wrong with using this method?

Sites I found while doing research on google."


RewriteEngine on
RewriteRule ^(browse|(admin)?tags|(submit)?id|info)/(.*) $1.php/$2



Look into MVC design patterns. It’s the same one that Ruby (Rails) uses as well as CakePHP (for PHP) as well as the Zend Framework. (a bit more advanced)

yerba# rm -rf /etc
yerba# _