Apache Web 服务器可以通过 .htaccess 文件来操作各种信息,这是一个目录级配置文件的默认名称,允许去中央化的 Web 服务器配置管理。可用来重写服务器的全局配置。该文件的目的就是为了允许单独目录的访问控制配置,例如密码和内容访问。 (continue reading…)
htaccess
Using php 5.4
We have php 5.2 as the default version of php on our shared hosting servers (as many scripts are not compatible with php version 5.4) , if you require php 5.4, or would like to test how your site / scripts runs with the new version of php, simply add the following line to a .htaccess file (in the folder where the scripts files are ) :
AddHandler application/x-httpd-php54 .php
This will then cause all scripts in that folder and folders below to parse using php 5.4
(Please note that ZendGuard and Zend Encoder and IonCube are currently NOT supported on php version 5.4 so if your script is an encoded using Zend Encoder you should use php 5.2 , if the script is encoded using IonCube or ZendGuard, then php version 5.3 can be used ) .
htaccess redirect only for MSIE 5 and 6 and winxp
RewriteEngine on
#
# Redirect IE 5 and IE 6 requests to version-specific subdomains
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\. [OR]
RewriteCond %{HTTP_USER_AGENT} Windows\ NT\ 5\.1
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=302,L]
.htaccess RewriteRule详解
1、Rewrite规则简介:
Rewirte 主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言。可基于服务器级的(httpd.conf)和目录级的(.htaccess)两种方 式。如果要想用到rewrite模块,必须先安装或加载rewrite模块。方法有两种一种是编译apache的时候就直接安装rewrite模块,别一 种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块。 (continue reading…)
Apache SSL in htaccess examples
Apache SSL examples in htaccess files
Any htaccess rewrite examples should always begin with
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
Fixing double-login problem and making sure authorization usernames/passwords are not sent in cleartext unencrypted. (continue reading…)
Htaccess文件用法集锦
1.时区设置
有些时候,当你在PHP里使用date或mktime函数时,由于时区的不同,它会显示出一些很奇怪的信息。下面是解决这个问题的方法之一。就是设置你的服务器的时区。你可以在这里找到所有支持的时区的清单。 (continue reading…)