Write apache rewrite in the next ubuntu

2010-09-04  来源:本站原创  分类:PHP  人气:163 

First of all, make sure your apache have it installed.

Then this sudo ln-s / etc/apache2/mods-available/rewrite.load / etc/apache2/mods-enabled/rewrite.load make rewrite

Module load module. Here involves a relationship between available and enable the former is available, the latter has already started loading the. ok?

My hands have a website, in the apache root directory / var / www folder under a baituan, this time in baituan folder create a new document. Htaccess, which fill in the content

RewriteEngine on
RewriteBase / baituan /
RewriteRule ^ pic / (\ d )+/?& pic.php? A = $ 1
RewriteRule ^ club /? $ Club.php? A = index
RewriteRule ^ club / register /? $ Club.php? A = register
RewriteRule ^ club / login /? $ Club.php? A = login
RewriteRule ^ club / (\ w )+/?$ club.php? A = $ 1 & b = home
RewriteRule ^ club / (\ w) + / (\ w )+/?$ club.php? A = $ 1 & b = $ 2
RewriteRule ^ club / (\ w) + / (\ w) + / (\ w )+/?$ club.php? A = $ 1 & b = $ 2 & c = $ 3
RewriteRule ^ actv /? $ Actv.php? A = index
RewriteRule ^ actv / (\ w) + / create /? $ Actv.php? A = $ 1 & b = create
RewriteRule ^ actv / (\ w) + / (\ w )+/?$ actv.php? A = $ 1 & b = $ 2 & c = home
RewriteRule ^ actv / (\ w) + / (\ w) + / (\ w )+/?$ actv.php? A = $ 1 & b = $ 2 & c = $ 3

Then I intend to visit a man named localhost / baituan / club / register page, it did forward to, but that get parameter is a = register is not transmitted in the past. I checked for a long time, know what to do. Later, see a post on the Internet.

http://serverfault.com/questions/60/mod-rewrite-does-not-forward-get-parameters

Found a solution. Here the design issue of a multiview

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo .*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.

Here is an apache negotiation problem.

For example, I create a test.html under baituan

Then lcoalhost / baituan / test will automatically request to test.html, this is the multiview. As to why this problem occurs here, and I do not know.

Now sudo gedit / etc/apache2/sites-enabled/000-default

Find here written

<Directory /var/www/baituan_temp/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</ Directory>

Determined to MultiViews removed, restart apache, problem-solving.

相关文章
  • Write apache rewrite in the next ubuntu 2010-09-04

    First of all, make sure your apache have it installed. Then this sudo ln-s / etc/apache2/mods-available/rewrite.load / etc/apache2/mods-enabled/rewrite.load make rewrite Module load module. Here involves a relationship between available and enable th

  • Apache rewrite rules for common applications (rewrite) 2010-04-01

    This article comes from: http://www.linuxforum.net of: Miss A Pavilion Jephe wu (2001-09-05 08:00:00) This paper provides how to use Apache rewrite rules to address some common methods of URL rewriting problem to the user through a common example of

  • apache rewrite rules 2010-03-12

    This paper provides how to use Apache rewrite rules to address some common methods of URL rewriting problem to the user through a common example of some of the basic methods to use rewrite rules and clues. 2: Why do I need to use rewrite rules? A sit

  • Reprinted apache rewrite rule 2010-06-08

    Reprinted http://www.javaeye.com/topic/579481 Apache Rewrite Rules Xiangjie: http://slj.me/2009/04/apache-rewrite-regular/ 1, Rewrite Rule Description: Rewirte main function is to realize the URL of the jump, it is based on Perl regular expression la

  • Apache Rewrite URL Jump basic and pseudo-static 2010-08-06

    Rewirte main function is to realize the URL of the jump, Rewirte code is based on Perl regular expression language. Based on the server level (httpd.conf) and directory level (. Htaccess) in two ways, and we generally use the Apache directory level (

  • Apache Rewrite open environment 2011-05-24

    Environment: System Windows Apache 2.2 Rewrite module loaded: Httpd.conf in the conf directory to find LoadModule rewrite_module modules / mod_rewrite.so Sentence, remove the front of the comment symbol "#", or add a phrase. Allows the use of an

  • Apache Rewrite to achieve a URL and domain name jump jump 2011-07-28

    Rewirte main function is to realize the URL of the jump, it is based on Perl regular expression language. Can be based on server-level (httpd.conf) and per-directory (. Htaccess) in two ways. If you want to use the rewrite module, you must first inst

  • Apache rewrite重写规则的常见应用 2013-10-24

    ---- 本文旨在提供如何用Apache重写规则来解决一些常见的URL重写方法的问题,通过常见的实例给用户一些使用重写规则的基本方法和线索. 一.为什么需要用重写规则 ---- 网站的生命在于不断地进行更新和维护,根据业务发展的需求转移服务器进行维护.重新组织目录结构.变换URL甚至改变到新的域名等情况是经常发生的.为了让客户不会因此受到任何影响,最好的方法就是使用Apache Rewrite Rule(重写规则). 二.重写规则的作用范围 ---- 1.使用在Apache主配置文件httpd.

  • Apache Rewrite url重定向功能的简单配置 2014-01-10

    Rewrite url重定向就是实现URL的跳转和隐藏真实地址,基于Perl语言的正则表达式规范.平时帮助我们实现拟静态,拟目录,域名跳转,防止盗链等 1.Apache Rewrite的主要功能 就是实现URL的跳转和隐藏真实地址,基于Perl语言的正则表达式规范.平时帮助我们实现拟静态,拟目录,域名跳转,防止盗链等 2.Apache Rewrite的配置 Apache下的Rewrite配置主要有两种,一种是针对整个apache服务器的配置,此种配置的Rewrite规则是直接在httpd.con

  • Apache Rewrite实现URL的301跳转和域名跳转 2014-02-01

    Rewirte主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言.可基于服务器级的(httpd.conf)和目录级的 (.htaccess)两种方式 如果要想用到rewrite模块,必须先安装或加载rewrite模块.方法有两种一种是编译apache的时候就直接安装rewrite模块,别一种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块. 基于服务器级的(httpd.conf)有两种方法,一种是在httpd.conf的全局下直接利

  • 13个实用的Apache Rewrite重写规则 2014-08-31

    这篇文章主要介绍了13个实用的Apache Rewrite重写规则,需要的朋友可以参考下 1.去掉域名中的www标记 RewriteCond %{HTTP_HOST} !^jb51\.net$ [NC] RewriteRule .? http://jb51.net%{REQUEST_URI} [R=301,L] 2.去掉www标记,但是保存子域名 复制代码 代码如下: RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?jb51\.net)$ [NC]

  • Apache Rewrite 大全 2011-06-01

    Apache Rewrite 大全 Apache的rewrite模块,提供了一个基于规则的重写(rewrite,也许译为重构更为合适)引擎,来实时重写发送到Apache的请求URL.因功能极其强大,被称为URL重写的"瑞士军刀". 这个模块使用一个基于正则表达式解析器开发的重写引擎,根据web管理员定义的规则来实时(on the fly)重写请求URL.它支持任意数目的重写规则,以及附加到一条规则上的任意数目的规则条件,从而提供了一套非常灵活和功能强大的URL处理机制.URL处理操作的

  • 在线将Apache Rewrite伪静态规则自动转换为Nginx Rewrite 2013-04-13

    在线将Apache Rewrite伪静态规则自动转换为Nginx Rewrite http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

  • WordPress 中文URL不支持 Apache Rewrite 不支持中文 Ipage不支持中文 2014-07-21

    WordPress 站,在国内空间上好好的,只是限制容量... 于是平移到国外Ipage空间上去,但是发现个致命的问题:不支持中文URL!!! http://my.codeweblog.com/cart/ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request - http://my.codeweblog.com/cart

  • Apache Rewrite实现URL的跳转和域名跳转 2014-12-30

    1.Rewirte主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言.可基 于服务器级的(httpd.conf)和目录级的 (.htaccess)两种方式.如果要想用到rewrite模块,必须先安装或加载rewrite模块.方法有两种一种是编译apache的时候就直接 安装rewrite模块,别一种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块. 基于服务器级的(httpd.conf)有两种方法,一种是在httpd.conf的全局

  • Apache Rewrite 规则详解 2015-05-12

    1.Rewrite规则简介 Rewirte主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言.可基于服务器级的(httpd.conf)和目录级的 (.htaccess)两种方式.如果要想用到rewrite模块,必须先安装或加载rewrite模块.方法有两种一种是编译apache的时候就直接 安装rewrite模块,别一种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块. 基于服务器级的(httpd.conf)有两种方法,一种是在ht

  • apache rewrite the URL in Substitution | RewriteRule directive 2010-05-07

    Rewrite the rules of the Substitution Pattern when match the original URL and when used as a substitute (or replace) the string. In addition to plain text, you can also include: Pattern reference on the reverse ($ N) The final match of the RewriteCon

  • apache rewrite to be static 2010-05-08

    mode-rewrite apache module is an important module, the main jump and rewrite the url to achieve, we must first start the module Under http.conf file in the module before removing the # sign, can be started, His configuration rules rewriteEngine on st

  • apache rewrite rewrite error debug 2010-06-22

    Embarrassed, always place a small rise to significant problems, Could this be the legendary technology? Encounter this problem, check for a long time, but actually just delete the last change a #. Apache url rewrite on debugging method can be used re

  • Configure apache to run under the ubuntu python script 2010-06-22

    Commonly used simple commands sudo apt-get remove - purge apache apache2 (completely remove) sudo / etc/init.d/apache2 restart sudo / etc/init.d/apache2 start sudo / etc/init.d/apache2 stop sudo makedir / home / htdocs sudo chmod 777 / home / htdocs