I have this code but it's not working as I expected.
What I need to do is to use the DirectoryIndex with parameters like this
DirectoryIndex /http://ift.tt/2ii2hVJ
and it's not working but if I used this one
DirectoryIndex /index.php?language=english&module=login
it works. I need the one with backslash because of the url so when the user visit my index file he should be redirected to the default url with parameters.
e.g.
If the user visit the http://xxx.xxx.xxx.xxx/ he should be automatically redirect to this url http://ift.tt/2i997j0
# 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 /http://ift.tt/2ii2hVJ
# 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>
Aucun commentaire:
Enregistrer un commentaire