我正在.htaccess文件來運行一個框架,我的測試,但是當我試圖進入我的本地主機,其中位於該框架的文件的文件夾沒有露面。 如果我嘗試訪問,請求localhost/my_hidden_folder/
這會引發500錯誤,內部服務器錯誤。的.htaccess它躲在我的文件夾在本地主機
此行爲與我的Apache的一些錯誤配置的結果| htaccess的,我敢肯定,因爲在另一臺服務器相同的.htaccess工作正常。
這裏是我的.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
這裏是/etc/apache2/sites-available
我的默認文件:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Directory /var/www/entrega2>
AllowOverride All
</Directory>
<Directory /var/www/unlp>
AllowOverride All
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
兩個文件夾,/var/www/unlp
和/var/www/entrega2
具有相同的.htaccess文件,都被隱藏。
在.htacces文件最基本的重定向不工作,在我的本地主機,但在服務器的工作原理。也許我有一個模塊被禁用?
嗨,謝謝你的回覆。你是對的'/ usr/lib/apache2/modules/mod_rewrite.so'中的mod_rewrite.so模塊沒有啓用。我修復它,運行'sudo a2enmod rewrite'這使模塊,我也寫在我的'httpd.conf'下一行:'LoadModule rewrite_module modules/mod_rewrite.so'。 – 4gus71n