J'ai un problème avec le fichier CodeIgniter .htaccess et j'espère que quelqu'un peut m'aider! Je ne connais pas les expressions régulières ou comment utiliser le .htaccess, je suis très nouveau avec ce genre de choses!CodeIgniter problème multi-application .htaccess
Mon problème est:
J'ai cette structure de fichiers (multi-applications): (! Qui fonctionne très bien sur localhost)
- application
- admin
- site
- system
- index.php
- admin.php
Et ce .htaccess
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Qu'est-ce que Je veux faire est:
Accéder à mon site web (frontend) avec http://www.mydomain.com/ Et mon admin (backend) comme http://www.mydomain.com/admin/
Je ne sais pas pourquoi cela fonctionne très bien sur mon serveur local.
J'espère que quelqu'un peut m'aider.
UPDATE
Je l'ai à travailler en utilisant ceci:
RewriteEngine on
# If the user types "index.php" or "admin.php".
RewriteCond $1 !^(index\.php|admin\.php|images|robots\.txt)
# If the user types just "admin".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin$ admin\.php [L,QSA]
# If the user enter in any admin section, like "admin/section".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin\/(.*)$ admin\.php/$1 [L,QSA]
# If the user types any site section, like "site/section".
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php/$1 [L,QSA]
De cette façon, je peux accéder à http://www.mydomain.com/admin ou http://www.mydomain.com/admin/any-section (que les points à "admin.php" dans le répertoire racine)
Et je peut accéder à http://www.mydomain.com/ ou http://www.mydomain.com/any-section (pointant vers "index.php" dans le répertoire racine)
Merci pour l'aide!
Salut, j'ai appliqué la solution. Le site principal fonctionne bien mais le site admin ne fonctionne toujours pas sans admin.php/.. Par exemple. admin/welcome/index ne fonctionne pas, il fonctionne avec admin.php/welcome/index –