저는 CodeIgniter를 사용 중이며 우분투 10.10 클라우드 서버에 LAMP 스택을 설치했습니다.allowoverride가 활성화되어 있어도 .htaccess가 작동하지 않습니다.
모든 것이 잘 작동하고 있으며, 내 홈 디렉토리가 /home/myapp/public_html
에 위치하도록 Apache userdir 모듈이 활성화되어 있고 servername/~myapp
으로 이동하여 액세스합니다.
불행히도 .htaccess
재 작성이 작동하지 않는 것 같습니다. the file /home/myapp/public_html/index.php
을 찾을 수 없으므로 404 오류가 발생합니다.
Mod_rewrite가 활성화되어 있습니다.
AllowOverride All
지시문을 설정해야한다는 사실을 알고 있습니다. /etc/apache2/sites-enabled/default
에 설정했습니다.하지만 다시 쓰기가 제대로 작동하지 않는 것 같습니다.
내 .htaccess
파일은 단순히 포함
RewriteEngine on
RewriteCond $1 !^(index.php|img|stylesheets|js|icons|robots\.txt|user_guide)
RewriteRule ^(.*)$ index.php/$1 [L]
그리고 내 /etc/apache2/sites-available/default
보이는 같은 :
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride ALL
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride ALL
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
과 같이 마지막으로, /etc/apache2/mods-enabled/userdir.conf
보이는 : 나는 인터넷 검색을 봤는데
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
</IfModule>
아무리 도와 주시겠습니까?
이것은 또한 나를 위해 일했습니다 .... 동일한 문제가있는 우분투 10.10에서 laravel을 사용합니다 ... – ftrotter
이 문제는 ubu 12.04LTS에서도 나에게 다가 왔고, 효과적이었습니다! 우리는 stackoverflow와 같은 것을 가지고 있습니다! – Mazzy
도와 드리겠습니다. :) – jonas