James Little
James Little

Reputation: 581

mod_rewrite: adding a 'fake folder' to all URLs?

How would I, in apache 2.4.9, add a fake folder to all URLs?

Example:

http://localhost/index.html

changes to

http://localhost/folder/index.html

?

Upvotes: 1

Views: 338

Answers (1)

anubhava
anubhava

Reputation: 785651

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^/?folder(/.*)?$ /$1 [L,NC]

Upvotes: 1

Related Questions