httpd.conf .htaccess

PHP Advanced and Object-Oriented Programming

Larry Ullman

The standard solution in these situations is to use the Apache Web server’s mod_rewrite module to allow for “prettier” URLs. mod_rewrite is a tool that lets you instruct the server that when the user goes to one URL, the server should provide another resource. mod_rewrite makes use of regular expressions, so the matching pattern and resulting actual URL can be as complex as needed.

These, and other changes to Apache’s behavior, can be made in two ways: by editing the primary Apache configuration file or by creating directory-specific files. The primary configuration file is httpd.conf, found within a conf directory, and it dictates how the entire Apache Web server runs (where the httpd.conf file is on your system will depend on many things). An .htaccess

file (pronounced “H-T access”) is placed within a Web directory and is used to affect how Apache behaves within just that folder and subfolders.

Generally speaking, it’s preferable to make changes in the httpd.conf file, since this file needs to be read only by the Web server each time the server is started. Conversely, .htaccess files must be read by the Web server once for every request to which an .htaccess file might apply.

时间: 2024-10-09 22:04:38

httpd.conf .htaccess的相关文章

Apache的配置httpd.conf文件配置

(1) 基本配置: ServerRoot "/mnt/software/apache2" #你的apache软件安装的位置.其它指定的目录如果没有指定绝对路径,则目录是相对于该目录. PidFile logs/httpd.pid #第一个httpd进程(所有其他进程的父进程)的进程号文件位置. Listen 80 #服务器监听的端口号. ServerName www.clusting.com:80 #主站点名称(网站的主机名). ServerAdmin [email protected

Apache的主配置文件:/etc/httpd/conf/httpd.conf

Apache的主配置文件:/etc/httpd/conf/httpd.conf默认站点主目录:/var/www/html/Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行.[[email protected] ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf [[emai

Apache2.2和Apache2.4中httpd.conf配置文件 权限的异同

Windows环境从Apache2.2改成Apache2.4后httpd.conf中的设置异同. 1.权限设定方式变更 2.2使用Order Deny / Allow的方式,2.4改用Require apache2.2: Order deny,allow Deny from all apache2.4: Require all denied 此处比较常用的有如下几种: Require all denied Require all granted Require host xxx.com Requ

apache httpd.conf配置及php.ini配置建议

1)     php.ini配置 扩展配置 (注意观察extention_dir路径是否与物理路径一致) extension=php_gd2.dll 几乎是必开,这个图形处理扩展被广泛地应用在上传头像处理.在线照片处理.验证码等等地方. extension=php_mbstring.dll 几乎也是必开,没有他,多字节字符串(如中文)截取将会变得异常的复杂. extension=php_pdo_mysql.dll PHP5.3默认已经集成了PDO(如果低于5.3的话应该会有extension=p

[Apache] Apache 從 2.2 換至 2.4 httpd.conf 的調整筆記 (windows 環境)

原文地址: http://www.dotblogs.com.tw/maplenote/archive/2012/07/20/apache24_httpd_conf.aspx 整理一下 Windows 環境 從 Apache 2.2 改成 Apache 2.4.1 後 httpd.conf 的設定筆記及遇到的問題 若有興趣可以先看一下官方文件說明 2.4 的差異 ( 我當然是...沒有看完 Orz ) http://httpd.apache.org/docs/2.4/upgrading.html

vim /usr/local/apache2/conf/httpd.conf

[[email protected] ~]# vim -n /usr/local/apache2/conf/httpd.conf 1 # 2 # This is the main Apache HTTP server configuration file. It contains the 3 # configuration directives that give the server its instructions. 4 # See <URL:http://httpd.apache.org/

Httpd主配置文件httpd.conf 详解

Apache的主配置文件:/etc/httpd/conf/httpd.conf默认站点主目录:/var/www/html/Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行.[[email protected] ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf [[emai

【转】Apache 的 httpd.conf 配置详解

Apache 的 httpd.conf 配置详解 原文链接 http://www.php100.com/html/webkaifa/apache/2009/0418/1192.html ServerRoot /usr/local ServerRoot用于指定守护进程httpd的运行目录,httpd在启动之后将自动将进程的当前目录改变为这个目录,因此如果设置文件中指定的文件或目录是相对路径,那么真实路径就位于这个ServerR oot定义的路径之下. ScoreBoardFile /var/run

Apache主配置文件httpd.conf 详解

http://www.linuxidc.com/Linux/2015-02/113921.htm Apache的主配置文件:/etc/httpd/conf/httpd.conf 默认站点主目录:/var/www/html/Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行.[[email protected] ~]# wc -l /etc/httpd/conf