.htaccess文件的位置 [英] location of .htaccess file

查看:171
本文介绍了.htaccess文件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

/ var / www / html / My_project_folder是我的项目的路径。我没有找到.htaccess文件。我想粘贴我编辑的.htaccess文件。但我不确定我需要放置哪个位置?
我的htaccess文件代码是 -

/var/www/html/My_project_folder is the path to my project. I did not find .htaccess file. I want to paste my edited .htaccess file . but i am not sure in which location i need to put? My htaccess file code is--

<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文件的位置。提前致谢!

This code i added in .htaccess file to speed up of my site. Please help me for location of .htaccess file. Thanks in Advance!

推荐答案

通常这个文件会进入您网站的根目录(您的索引。 php 文件是)。如果没有,您可以创建一个新文件。但请注意不要创建类似.htaccess.txt的东西,如果你使用记事本(通常会将.txt附加到所有文件)。

Usually this file goes to the root of your website (where your index.php file is). If there is none, you can create a new file. But watch out not to create something like ".htaccess.txt" if you do it with notepad (which usually appends .txt to all files).

这篇关于.htaccess文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆