0

I have a regex expression in my .htaccess. Took me ages to finally get it going. What I'm trying to do is grab anything after the domain and if there is a valid file display it, otherwise handle the URL for a vanity URL. The problem is it only works case sensitive so if there if default.html and Default.html are used for example one. I've tried fooling with it for days and all I've gotten is 500 errors. Maybe someone sees something I'm doing wrong here, still new to regex and the .htaccess.

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)         /URLHandler.php          [NC,L]
TheHamstring
  • 712
  • 2
  • 6
  • 22
  • Is...there a difference in the `default.html` and `Default.html`? – Ohgodwhy Jul 08 '14 at 02:17
  • Well, does your `URLHandler.php` contain the required `glob` logic? What des the error.log say about the 500 error? Your whole RewriteRule set, btw, could be replaced by `FallbackResource`. Alternatively use `mod_speling` with `CheckCaseOnly`, possibly combine with MultiViews. – mario Jul 08 '14 at 02:19
  • There is no difference in default.html and Default.html because they are the same file. The difference is the request. – TheHamstring Jul 08 '14 at 07:48
  • After looking into this more with the comments I received I'm noticing the whole site is case sensitive. That's a problem I'm going to have to deal with first. – TheHamstring Jul 08 '14 at 08:00

0 Answers0