. htaccess file cannot be pseudo-static workaround

Source: Internet
Author: User
Tags svn

First: Enable rewrite and. htaccess settings

Rewrite settings : Locate the Apache configuration file httpd.conf file, find: #LoadModule rewrite_module modules/mod_rewrite.so Remove the previous # 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 do not 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 multiple virtual directories are configured to be opened in each directory, the instance:

<virtualhost *:80>
DocumentRoot "D:svntracsvnsvnrepositorywwwroot"
ServerName 127.0.0.1:80

DirectoryIndex index.html index.htm index.php index.shtml
<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: Options settings

The default setting is: Options Indexes followsymlinks
If you change to the following settings, an error occurs
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, finally remind everyone, remember to change the configuration file after the server must be restarted AH. Have questions, leave a message, or listen to the meager.

I tried to do not above, and finally found that the rewrite rules in front of the extra slash

Rewriteengine on

Rewriterule ^index.html$/index.php [L]

Change it to the bottom, OK.

Rewriteengine on

Rewriterule ^index.html$ index.php [L]

. htaccess file cannot be pseudo-static workaround

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.