I am a newb to PHP. Can anyone tell me what each line does here. Do I need this? It is giving me errors
RewriteCond %{REQUEST_URI} /~([^/]+)/? RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /~%1/rewrite.php?p=$1&%{QUERY_STRING} [L] RewriteCond %{REQUEST_URI} /~([^/]+)/? RewriteRule ^index\.php?(.*)$ /~%1/rewrite.php?p=%1&%{QUERY_STRING} [L] #there is no ~ character in the URL RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) ./rewrite.php?p=$1&%{QUERY_STRING} [L] RewriteRule ^index\.php?(.*)$ ./rewrite.php?p=$1&%{QUERY_STRING} [L] #WJ-180 fix RewriteRule ^resume\.php?(.*)$ ./rewrite.php?p=resume\.php$1&%{QUERY_STRING} [L]
The simple answer: These declarations rewrite every request to a
rewrite.phpfile.The more comprehensive answer: The
RewriteCondandRewriteRuledirectives are from the Apache module mod_rewrite and provide a rule based URL rewrite mechanism.It seems that these rules are intended to rewrite every request to a
rewrite.phpfile, either in a specific directory (/~foobar/rewrite.php) or in the root (/rewrite.php).