3

This is my code in .htaccess:

RewriteEngine On

RewriteRule ^(.*)$ framework/public_html/index.php/$1 [PT,L]

I'm getting "Internal Server Error". What's wrong?

Pat R Ellery
  • 1,696
  • 3
  • 22
  • 40
Jazi
  • 6,569
  • 13
  • 60
  • 92

1 Answers1

4

Try this:

RewriteCond %{REQUEST_URI} !^/framework/public_html/
RewriteRule ^(.*)$ framework/public_html/index.php/$1/ [PT,L,NC,QSA]

http://www.domain.com/sub/folder/me => [REQUEST_URI] => /sub/folder/me

First, when you want to redirect (.*) it also try to redirect to itself that is why you have a 500 error. so by saying: if it's not (!^) /framework/public_html/ then redirect to this URL.

QSA: Query string append means if you have ?var=1 it will use it and append to the redirected string.

NC: Non Case means capital letters and lower case letters are the same.

Book Of Zeus
  • 49,509
  • 18
  • 174
  • 171
  • Well, the problem is, that I need slashes in it. – Jazi Oct 02 '11 at 16:41
  • Yeah! It works! :] Thanks. Could You tell me what the first line of code means? And for what those NC, QSA tags are for?? – Jazi Oct 02 '11 at 19:49