My HTAccess was working before. But I wanted to add an FTP section to the site. It is decided that all FTP will go in /ftp and all requests to /ftp/... will be internally redirected to /ftp.php?dir=... that handles authentication and such before using readfile(...). Being a n00b at regex, I assumed this would work: (only the ftp section was added and the |ftp added)
RewriteEngine On
# http://httpd.apache.org/docs/2.4/rewrite/flags.html
# Match page
RewriteCond %{REQUEST_URI} !^/?(cydia|firmware|scripts|site|ftp)
RewriteCond %{REQUEST_URI} !^/?(robots.txt|ftp.php)
RewriteRule ^/?(.*)$ /site/index.php?title=$1 [PT,L,QSA]
# Match FTP
RewriteCond %{REQUEST_URI} ^/?ftp
RewriteRule ^/?(.*)$ /ftp.php?dir=$1 [PT,L,QSA]
RewriteRule ^/*$ /site/index.php [L,QSA]
Basically, what I did was (I think) match /ftp as a true instead a false like above. However, this gives me a 500 Server Error throughout the site (indicating a problem in the HTAccess). I’m sure this is a simple error, but I’m hoping you can help me with this.
Your issue is that those too line will redirect everything starting with ftp (including http://ftp.php and this will create an infinite loop)
Try replacing them with this :