0
私はこのコードを持っていますが、期待通りに機能しません。私がする必要がどのような。リダイレクトのための.htaccess directoryIndexが動作しません。
この
DirectoryIndex /index.php/english/login/
のようなパラメータでのDirectoryIndexを使用することであり、それが働いていないが、私はこの1つ
DirectoryIndex /index.php?language=english&module=login
を使用した場合、それは動作します。 URLのためバックスラッシュのあるものが必要です。ユーザーがインデックスファイルを参照するとき、パラメータを持つデフォルトのURLにリダイレクトする必要があります。
ユーザーが訪問した場合、彼は自動的にhttp://xxx.xxx.xxx.xxx/english/login/
# Rewrite Rules
RewriteEngine on
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ index.php?language=$1&module=$2 [L,QSA]
# Declare Environments
SetEnvIf Request_URI "^.*" default_url=//xxx.xxx.xxx.xxx/english/login/
# Default Landing Page
DirectoryIndex /index.php/english/login/
# Error Redirection
# Error 403 - Forbidden
ErrorDocument 403 http:%{ENV:default_url}
# Error 404 - Not Found
ErrorDocument 404 http:%{ENV:default_url}
# Prevent Directory Listing
Options -Indexes
# Protect Files
<Files configuration.ini>
Order allow,deny
Deny from all
</Files>
それは働いていないと私はある達成するために必要ユーザーがhttp://xxx.xxx.xxx.xxx/ではなくhttp://xxx.xxx.xxx.xxxにアクセスした場合、ユーザーをhttp://xxx.xxx.xxx.xxx/english/loginにリダイレクトする?言語=英語&モジュール=ログイン –
これはちょうど 'RewriteRule^$ index.php?language = $ 1&module = $ 2 [L、QSA]' –
が動作します。ありがとう –