/var/www/html/My_project_folder是我的項目的路徑。我沒有找到.htaccess文件。我想粘貼我編輯的.htaccess文件。但我不確定我需要放置哪個位置? 我htaccess文件代碼is--.htaccess文件的位置
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year」
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month」
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
此代碼我在.htaccess文件添加到我的網站的加快。請幫助我找到.htaccess文件的位置。提前致謝!
根我的項目的項目文件夾,我需要創造這個.htaccess文件下意味着什麼? – Unique 2014-11-05 12:19:00
完全在「/ var/www/html/My_project_folder」中。並檢查您是否使用「a2enmod rewrite」在apache上啓用了mod,否則您的.htaccess文件將無效 – 2014-11-05 12:23:18
謝謝。我可以知道如何通過ssh啓用mod嗎? – Unique 2014-11-05 12:35:51