How to hide folders

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
arunas0813
 
 
Posts: 15
Joined: Wed Nov 29, 2023 2:26 pm

How to hide folders

Post by arunas0813 »

Hello,
can You help and explain how to hide folders in website structure ? folder properties... ? htaccess ?
What is the best way ?
www.host.com/folder/page.html -> www.host.com/page.html
User avatar
BaconFries
 
 
Posts: 5640
Joined: Thu Aug 16, 2007 7:32 pm

Re: How to hide folders

Post by BaconFries »

Moved to the following Off Topic Section as unrelated to the use of the software.
htaccess ?
Not tested but you can try adding the following to your htaccess if you have one substituting pages for your own folder name. For further help on the use of .htaccess you should contact your hosting provider.

Code: Select all

RewriteEngine on
RewriteRule ^pages/(.+)$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) /pages/$1 [END]
Post Reply