Apache pseudo-static configuration method

Source: Internet
Author: User

Apache pseudo-static configuration method

Apache pseudo-static html (URL Rewrite) setting method

Phpma: Open the configuration file httpd. conf of Apache.

Phpma 2: # LoadModule rewrite_module modules/mod_rewrite # Remove

Phpma 3 is added in httpd. conf:

<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteCond % {ENV: SCRIPT_URL }(? : Index | dispbbs00000000-0-900000000.html
RewriteRule ^ (.*? (? : Index | dispbbs00000000-(-0-942500000000.html $ 1.php?

_ Is_apache_rewrite = 1 & __ rewrite_arg = $2
</IfModule>

 

<Ifmodule mod_rewrite.c>
RewriteEngine On
RewriteRule/news/top2007,(d000000000000.html $/news/readmore. php? Id = $1
</Ifmodule>
4. Save httpd. conf and restart apache.


Apache Web Server (Independent host user)

First, determine the Apache version you are using and whether the mod_rewrite module is loaded.

For Apache 1.x users, check whether the following two sections of code exist in conf/httpd. conf:

LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c

For Apache 2.x users, check whether the following code exists in conf/httpd. conf:

LoadModule rewrite_module modules/mod_rewrite.so

If yes, add the following code to the configuration file (usually conf/httpd. conf. Be sure

Note: If the website is defined by a virtual host, add it to the virtual host configuration, that is, <VirtualHost>

. After modification, restart Apache.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^ (. *)/ivideo (-TV-([0-9] + ))? (-Ti-([0-9] + ))? (-Tc-([0-9] + ))? (-Page-

([0-9] + ))?. Html $1/ivideo. php? TV = $3 & ti = $5 & tc = $7 & page = $9
RewriteRule ^ (. *)/ispecial (-TV-([0-9] + ))? (-Ti-([0-9] + ))? (-Tc-([0-9] + ))? (-Page-

([0-9] + ))?. Html $1/ispecial. php? TV = $3 & ti = $5 & tc = $7 & page = $9
RewriteRule ^ (. *)/icategory.html $1/icategory. php
RewriteRule ^ (. *)/category-cid-([0-9] +) (-tag-([^-] *)? (-Timelimit-([0-9] + ))? (-

Orderlimit-([0-9] + ))? (-Page-([0-9] + ))?. Html $1/category. php?

Cid = $2 & tag = $4 & timelimit = $6 & orderlimit = $8 & page = $10
RewriteRule ^ (. *)/vspace-(mid | username)-(.20.20..html $1/vspace. php? $2 = $3
RewriteRule ^ (. *)/video-(vid | ivid0000-(.20.20..html $1/video. php? $2 = $3
RewriteRule ^ (. *)/special-spid-(%0-9%%%%%.html $1/special. php? Spid = $2
</IfModule>
If mod_rewrite is not installed, you can recompile Apache and add

Enter -- enable-rewrite = shared, and then add the above code to the Apache configuration file.

Apache Web Server (virtual host user)

Before starting the following settings, please first consult your space service provider, whether the space supports Rewrite and whether it supports

Parse the. htaccess file in the site directory. Otherwise, it cannot be used even if it is set as follows.

Check whether the. htaccess file exists in the directory where the podcast is located. If not, create this file manually. Win32

The. htaccess file cannot be directly created in the system. You can copy one copy from another system or

Download this file from the discuz.net technical support section. Edit and modify the. htaccess file and add the following content #

Enable RewriteEngine mode
RewriteEngine On
# Modify/supev in the following statement to your podcast directory address. If your program is in the root directory, set/supev

Change/
RewriteBase/supev
# Do not modify RewriteRule in Rewrite system rules

RewriteRule ^ ivideo (-TV-([0-9] + ))? (-Ti-([0-9] + ))? (-Tc-([0-9] + ))? (-Page-([0-9]

+ ))?. Html $ ivideo. php? TV = $2 & ti = $4 & tc = $6 & page = $8
RewriteRule ^ ispecial (-TV-([0-9] + ))? (-Ti-([0-9] + ))? (-Tc-([0-9] + ))? (-Page-([0-

9] + ))?. Html $ ispecial. php? TV = $2 & ti = $4 & tc = $6 & page = $8
RewriteRule policicategory.html $ icategory. php
RewriteRule ^ category-cid-([0-9] +) (-tag-([^-] *)? (-Timelimit-([0-9] + ))? (-

Orderlimit-([0-9] + ))? (-Page-([0-9] + ))?. Html $ category. php?

Cid = $1 & tag = $3 & timelimit = $5 & orderlimit = $7 & page = $9
RewriteRule ^ vspace-(mid | username)-(.20.20..html $ vspace. php? $1 = $2
RewriteRule ^ video-(vid | ivid316-(.w.20..html $ video. php? $1 = $2
RewriteRule extends special-spid-(%0-9%%%%%.html $ special. php? Spid = $1


<VirtualHost *: 80>
DocumentRoot/home/www_php168
ServerName www.111cn.net
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^ (. *)/list-(%0-9%%%%%-(%0-9%%%%%%.htm $1/list. php? Fid = $2 & page = $3
RewriteRule ^ (. *)/bencandy-(0-9000000000000-(0-9000000000000-(0-90000000000000000.htm $1/bencandy. php?

Fid = $2 & id = $3 & page = $4
</IfModule>
</VirtualHost>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.