URL重写目录名称[关闭]

I have my website directory like this:

  • application
  • assets
  • system

And under application I got this:

  • help
  • contact

I created a file inside each one called index.php so the URL can look something like this, but I have seen so many websites with an URL like this, I've seen this is made with .htaccess file, but the problem is that I don't know where should I put it and how to set it up.

Would be nice if you put some examples.

The apache site has tons of examples. http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

This isn't tested, but something like this should suffice.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/application/
RewriteRule ^(.*)$   /application/$1 [L,QSA]