Forum Moderators: coopster
[somesite.com...]
becomes
[somesite.com...]
With some automagic that happens in articles.php.
What I want to do is make it so the URL can be this:
[somesite.com...]
using PATH_INFO in the default page in the root of the site. Is there a way I can do this, without using a hack like using a PHP script for the 404 page?
Getting too terse requres a lot of planning, however. For example, if you get rid of your fake /articles/ directory, how will you differentiate the contents of that when you want to include a /news/ section? Also, you're likely to run into problems on the day when some-article-name happens to be the same as some physical directory, like if you have an article about includes, and you also have a directory called includes. The ability to make pretty and friendly urls is great, but if you plan for the site to become very complex I think it's important to assign absolute meaning to some parts of them (like /article/) to allow the rest of them to be more flexible.
<a href="http://example.com/path/to/mypage">My Page</a>
... on your site, PHP_SELF is going to contain the script name, including extension while the acutally URI requested will not:
This knowledge becomes extremely useful at times.
PHP_SELF. . . : /path/to/mypage.php
REQUEST_URI . : /path/to/mypage