cocoa coder
cocoa coder

Reputation: 214

PHP redirect & url rewrite

I have tried already a couple of ways using URL redirect, but I am no good in php.

RewriteEngine on
RewriteRule ^/Folder/([0-9]+)$ example.com/

I have a problem, the sub folders & files of my server are case-sensitive, for example:

www.example.com/Folder/index.html
  1. How can I make them case insensitive, or redirect alternative spellings to:

    www.example.com/Folder/
    
  2. I also want to hide the actual URL of all sub folders and files, e.g. only the below should be shown, not any sub-items.:

    www.example.com/Folder
    

I have no CMS, only static HTML pages.

Upvotes: 0

Views: 137

Answers (1)

George Brighton
George Brighton

Reputation: 5151

You can use mod_speling to allow case-insensitive URLs. It is bundled with the default installation of Apache; you just have to enable it in .htaccess:

CheckSpelling On

To hide files, turn directory listings off:

Options -Indexes

Upvotes: 1

Related Questions