Apache under htaccess does not work, Linux,windows detailed __linux

Source: Internet
Author: User

The following three kinds of error possibilities may occur:

first: Enable rewrite and. htaccess Settings

rewrite settings : Find Apache configuration file httpd.conf file, find: #LoadModule rewrite_module modules/mod_rewrite.so Remove the front # number.

Instead: LoadModule rewrite_module modules/mod_rewrite.so

. htaccess Settings :

Windows inside this setting: Accessfilename htaccess

Linux inside this setting: Accessfilename. htaccess.

Linux has one more point in front of the file name in Windows. If you don't find accessfilename yourself at the back of the httpd.conf file, add.

the second type: allowoverride settings.

The default allowoverride is allowoverride none. Change this to: allowoverride all. If you have multiple virtual directories configured to open in each directory, instance:

<virtualhost *:80>
        documentroot "D: Svntracsvnsvnrepositorywwwroot "
        ServerName 127.0.0.1:80
 
        directoryindex index.html index.htm index.php index.shtml
 & nbsp;     <directory "D:svntracsvnsvnrepositorywwwroot"
            Options Indexes followsymlinks
            allowoverride All
           order Allow, Deny
           Allow from all
        </directory>
</VirtualHost>

<virtualhost 127.0.0.2:80>
DocumentRoot "d:/svntrac/svn/svnrepository/www/"
ServerName 127.0.0.2:80

DirectoryIndex index.html index.htm index.php index.shtml
<directory "d:/svntrac/svn/svnrepository/www/" >
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>

The third type: the setting of Options

The default setting is: Options Indexes followsymlinks
If you change to the following settings, you will get an error
Options Indexes followsymlinks multiviews Includes (Error)
If you want to enable, directory browsing MultiViews
Server side contains Includes (<!– #include virtual= "top.htm" –>)

For simplicity it can be set to: Options all

The first two are common in the configuration of errors, the third is generally rare, and finally remind everyone, remember that after the configuration file changes must restart the server AH. Have questions, leave a message, or listen to a meager.

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.