0

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.

6
  • Are you using Apache? Commented Sep 15, 2013 at 18:04
  • I think case-sensitivity doesn't play any role here. Commented Sep 15, 2013 at 18:04
  • What exactly do you want to do, I understand you don't want to show sub folders but what you want? By default that directory should open the index.html so nothing else would be displayed. What does PHP have to do with this if you're talking about HTML pages and shows nothing of what you've tried with PHP? Your question is very unclear as it is. Commented Sep 15, 2013 at 18:09
  • This does not concern PHP one bit. It's all about server-side URL routing...PHP only comes in play when/if you need particular and flexible routing logic. Commented Sep 15, 2013 at 18:16
  • the question is directed towards htaccess to hide sub-folders. For example: there are 5 different html pages in /Folder, which can be accessed through the main index.html page, but show page2.html when openend. But I don't want to show that, only alway example.com/Folder and no example.com/Folder/page.html. Clearer now? Commented Sep 15, 2013 at 18:17

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

2 Comments

mh.. I tried it, but that just made all pages inaccessable. ( even only CheckSpelling ON )
here's what I tried: RewriteEngine on RewriteRule ^/Folder/([0-9]+)$ example.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.