Enable htaccess file work in Apache
1, Load LoadModule module in Apache
1) Find the “httpd.conf” file under the “conf” folder inside the Apache’s installation folder.
2) Find the following line “#LoadModule rewrite_module modules/mod_rewrite.so” in the “httpd.conf” file.You can do this easily by searching the keyword “mod_rewrite” from find menu.
3) Remove the “#” at the starting of the line, “#” represents that line is commented.
4) Now restart the apache server.
5) You can see now “mod_rewrite” in the Loaded Module section while doing “phpinfo()”.
2, Allow override in Apache config file
Find the Directory for DocumentRoot part, replace AllowOverride None with AllowOverride All.
3, Place a .htacess file under root directory in project file, and write rewrite rule, a example is:
#Rules for Versioned Static Files
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^tpl/(js|css)/(.+)\.(.+)\.(js|css)$ tpl/$1/$2.$4 [L]
RewriteRule ^tpl/public/js/(.+)\.(.+)\.js$ tpl/public/js/$1.js [L
(For rewriting js/css file with last modified time to its really name).
转载于:https://blog.51cto.com/peterding/890920
Enable htaccess file work in Apache相关推荐
- Apache服务器中的.htaccess文件的配置
如何在windows下创建.htaccess文件 首先, 暂且别管.htaccess是什么, 有什么作用, 让我们暂且解决首要问题:如何在windows下创建.htaccess文件. 在windows ...
- php_flag .htaccess,Apache服务器中.htaccess文件的实用配置示例集锦
.htaccess 是什么? htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件.这些文件可以 ...
- Apache 中 .htaccess 文件设置技巧16则
.htaccess 文件 (Hypertext Access file) 是Apache Web服务器的一个非常强大的配置文件,对于这个文件,Apache有一堆参数可以让你配置出几乎随心所欲的功能.. ...
- 无聊的apache错误(.htaccess pcfg_openfile)
apache的错误见得不少,可是这个错误还真被忽略了,今天一台web服务器出现访问403异常,查看配置文件均无问题,而在error.log文件中,给出了类似这么几行提示: [Tue Oct 26 12 ...
- 详解Apache下.htaccess文件的8个用法
.htaccess文件允许我们针对特定目录及其子目录修改一些服务器设置,虽然这种类型的配置最好是在服务器本身配置文件的小节部分处理,但有时我们根本没有权限访问这个配置文件,尤其是当我们在一台共享的托管 ...
- linux apache htaccess,Apache下htaccess的配置使用详解
Apache下htaccess的配置使用详解 看到群里很多前辈都在讨论.htaccess的用法,自己之前也小用过,只做了404的重定向,当然.htaccess的功能远不止这些,他还可以帮助我们做很多( ...
- apache .htaccess 禁止访问某目录方法
2019独角兽企业重金招聘Python工程师标准>>> 最简单方法,在所要禁止的目录中的.htaccess文件中添加一下两行代码. order allow,deny deny fro ...
- 如何让apache支持.htaccess 解决Internal Server Error The server …错误
如何让apache支持.htaccess 解决Internal Server Error The server -错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...
- PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误
TP框架 打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...
最新文章
- js中,(function(){})()的用法解析
- 创建自定义Widgets小部件扩展
- java性能调优工具--笔记
- cheatengine找不到数值_彩票中奖500万,领了还不到一半?这些问题不解决,钱都拿不走...
- 网易资深Java架构师:疫情对java行业的影响分析
- Vue中 $ref 的用法
- HDU 4651 Partition(整数拆分)
- zbb20180613 Spring MVC实现大文件下载功能
- 开源框架Struts:FormBean滴那些事儿
- curl 安装_实用干货——如何使用curl命令下载文件
- xgboost分类原理
- python舆情分析系统设计与实现_基于Python的手机舆情系统综述
- andorid 查看 Activity任务栈
- zabbix如何监控ip地址_zabbix 监控ip地址
- 如何将HTML与win10桌面壁纸,如何在Windows 10中将页面设置为桌面背景 | MOS86
- Intelij的IDEA启动报错!parent directory is read-only or the user lacks necessary permissions
- WinForm实现Loading等待界面
- 简单几步,让Mac外接显示器更好用
- 控制台安装mysql步骤_mysql5.6安装步骤-win7系统
- 【idea】IntelliJ IDEA如何快速的定位数据库某张表在哪里调用---超详情!!!
热门文章
- jpa 指定字段内容按照顺序排序(orderBy when then)
- linux ps -aux 中stat含义:
- mq 自动消费 php,php – 从RabbitMq消费不确认消息
- 【RocketMQ工作原理】消息堆积与消费延迟
- javascript中对象在OOP方面的一些知识(主要是prototype和__proto__相关)
- 计算机专业美国最好的学校排名,美国计算机专业大学排名
- mysql教程联合索引_MySQL中的联合索引学习教程
- 安装npm_前端开发:node.js的node包管理器npm安装以及使用
- gdal java shp_【GDAL/OGR】利用GDAL/OGR读取shp文件并转换为json文件(Java版)
- hbase1.1.1 连接集群_除了HAProxy,RabbitMQ集群还可以这样用