http://example.com/index.php?path=controller/function
への URLをマスクしたいhttp://example.com/controller/function
。function
存在する必要はありません。
htaccessファイルでこれを行うにはどうすればよいですか?
以下は動作しません。
RewriteRule ^/?assets/(.*)$ assets/$1 [L] # directory for CSS, images, and JavaScript
RewriteRule ^$ /index [redirect]
RewriteRule ^([a-zA-Z]+)/?([a-zA-Z/]*)$ index.php?path=$1/$2 [L]
現在、http://example.com/controller/function
ブラウザで入力すると 404 エラーが発生しますが、入力http://example.com/index.php?path=controller/function
は機能します。
ありがとう!