I believe this can be a really quite simple question.

How can you an apache rewrite to cover a folder.

EX: world wide web.website.com/pages/login.php to world wide web.website.com/login.php

or world wide web.website.com/pages/home.php to world wide web.website.com/home.php

The folder must alway be hidden. thanks

I suppose what you would like is perfect for the browser to request /home.php however the server to really make use of the file situated at /pages/home.php, right? If that's the case, this will work:

Make certain the apache mod_rewrite module is installed. Then, use something similar to this inside your apache config, virtual host config, or (less desirable) .htaccess file:

RewriteEngine On
RewriteRule ^/(.*)$   /pages/$1

The guidelines use regular expressions, so you might want to take a look at a reference on that subject if you are unsure. Browse the manual for more information on other directives (RewriteCond can be quite helpful) or rule options.

In case your example really reflects the files you'll need, then inside your .htaccess file:

#Options +FollowSymLinks
RewriteEngine On

RewriteRule ^/pages/(.+)\.php $1\.php [NC, L]

Also, when the directory has read permission, it can't be, the truth is "hidden". I suppose you imply that it no more seems within the url.