Domanda

with the idea of ​​protecting / limit access to folders codeigniter, I created a public folder. The main idea is that users can only access the public folder

<VirtualHost *:80>
     DocumentRoot "www / codeigniter / public"
     <Directory "www/codeigniter">
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all Granted
     </ Directory>
</ VirtualHost>

This works, but when I try to clean the url, so it does not appears the index.php generates an errror 503.

the .htaccess file I created is as follows

<IfModule mod_rewrite.c>
 Options + FollowSymLinks
 RewriteEngine On
 RewriteCond% {REQUEST_FILENAME}!-D
 RewriteCond% {REQUEST_FILENAME}!-F
 RewriteRule ^ (. *) $ Index.php? / $ 1 [L]
</ IfModule>

What am I doing wrong or that I left to do?

pardon the English, GoogleTranslate

È stato utile?

Soluzione

Your .htaccess has some strange spacing issues that break the site when I replicate them on one of my codeigniter sites. I would try with these changes.

<IfModule mod_rewrite.c>
 Options +FollowSymLinks
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top