CodeIgniter コントローラー関数へのパブリック アクセスをブロックしようとしていますが、この .htaccess ルールは機能しません。
#Block External Access to create pdfs function
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.0
RewriteCond %{REMOTE_ADDR} !^x\.x\.x\.x
RewriteCond %{REQUEST_URI} ^/applicationForm/createPDF
RewriteRule ^(.*)$ index.php/$1 [F,L]
x がサーバーのパブリック IP に置き換えられていることに注意してください。
なぜこれがうまくいかないのかわかりません。
mod の書き換えの残りの部分は正常に動作しています。
#Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]