. htaccess set the order of the site's default home page
Add the following line to the. htaccess file:
The code is as follows
Copy Code
DirectoryIndex index.html index.htm index.php
Htaccess set 404 Error page
The allowoverride parameter is to indicate whether the Apache server is looking for a. htacess file as a configuration file, and if set to none, the server ignores the. htacess file, if set to all, Then all the instructions in the. htaccess file
Reproduced original address: http://www.jb100.net/html/content-22-741-1.html. htaccess files (hypertext Access file) is a very powerful configuration file for Apache Web servers, and for this file, Apache has a bunch of parameters that allow you to
# Setenv application_env Production
Setenv application_env Development
# PHP setting
# Make sure the default timezone is set
# Can also be set within application using date_default_timezone_set
#....
#==========================
As a user, the commands you can use are limited. Administrators can set up by using Apache's allowoverride directives. Directives in subdirectories overwrite instructions in higher-level directories or primary server configuration files.
I. Locating
# Enable rewriteengine on in rewriteengine mode # Modify/discuz in the following statement to your forum directory address. If the program is placed in the root directory, please change/discuz to/rewritebase/discuz # rewrite system rule. Do not
Under Windows, we typically use the administrator account, so enabling these two is simple:
Found in the Apache installation directory]/conf/httpd.conf
#LoadModule Rewrite_module modules/mod_rewrite.so
, remove the previous annotation symbol #.
Many ways to create:
1, the use of DOS commands, in DOS There are three ways to choose:
Use screen Editing command copy con. htaccess, enter the content, and finally press Ctrl+z end Edit, the successful generation. htaccess;Using the rename
Access|apache-. htaccess files (or distributed profiles) provide a way to configure changes to a directory, that is, to place a file containing one or more directives in a specific document directory to work on this directory and all its
First, let's take a look at this. htaccess file:Rewriteengine Onrewritecond%{request_filename}-S [Or]rewritecond%{request_filename}-l [OR]RewriteCond%{REQUEST_ FILENAME}-drewriterule ^.*$-[Nc,l]rewriterule ^.*$ index.php [nc,l]There are 3
"Apache under rewrite unsuccessful"
Did not successfully follow the following three steps:
"First step: Open rewrite Module No"
First we find the/CONF/HTTP.CNF in the Apache installation directory.
Open, File Search rewrite find
#LoadModule
After discovering, although wget follow robots.txt rules, but that still can go around, now I use the shielding method to share to everyone:
1. screen download any file
. htaccess
Setenvifnocase user-agent "^wget" Bad_bot
order
Allow,deny
Enable. htaccess, you need to modify httpd.conf, enable allowoverride, and use allowoverride to limit the usage of specific commandsGenerally speaking,. Htaccess can help us implement include: folder password protection, user Auto Redirect, custom
Apache Configuration
The Apache configuration is configured by the httpd.conf file, so the following configuration directives are modified in the httpd.conf file.Configuration of the primary site (basic configuration)
(1) Basic configuration:
System environment: Windows Apache 2.2
Load Rewrite module:
Found in httpd.conf in the Conf directory
LoadModule Rewrite_module modules/mod_rewrite.so
This sentence, remove the front annotation symbol "#", or add this sentence.
Allow the ".
After opening the httpd.conf file with a text editor open, look for
The code is as follows
Copy Code
Options FollowSymLinksAllowOverride NoneSwitchOptions FollowSymLinksAllowOverride All
But I didn't
What is the. htaccess?. Htaccess is called a distributed configuration file, which provides a way to change the configuration of a directory by placing a file containing one or more instructions in a particular document directory to act on this
I have never encountered two apacheerrorlog errors-Linux Enterprise Application-Linux server application information. The following is a detailed description. Today, two apache errors have not been encountered before:
1. Permission denied:.
1. URL Builder URL: (do not write regular expressions, which can be generated using the following tools !)
Http://seohelper.cn/tools/urlrewrite
Generate two different URL rules based on the written URL (that is, regular expression)
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.