Turn on pseudo-static for PHP

Source: Internet
Author: User
Tags web hosting

1.detects if Apache supports mod_rewrite to view the environment configuration via PHP's Phpinfo () function via CTRL+F Find "Loaded Modules", which lists all the modules that Apache2handler has been turned on, if it includes "mod_rewrite", it is already supported and no longer required to continue setting. If "Mod_rewrite" is not turned on, open the directory for your Apache installation directory "/apache/conf/"under the httpd.conf file, via CTRL+f find "LoadModule rewrite_module", the previous "#"number to delete. if not found, go to the "LoadModule" area and add "LoadModule rewrite_module modules" on the last line./mod_rewrite.So "(required exclusive line), then restart the Apache server. 2. In httpd.Configuring a virtual host in Conf#virtual hosts enable web hostingIncludeConf/extra/httpd-vhosts.conf3.httpd_vhosts.conf file, configure the appropriate options.Detailed explanation<virtualhost *:80>DocumentRoot"C:/MYENV/APACHE/HTDOCS/STATIC3"ServerName www. HSP.com<directory "C:/MYENV/APACHE/HTDOCS/STATIC3" >#Deny from all 403 error prompt allow from all#If the file directory is outside the Apache directory, comment out Optinos, not the list.Options +Indexes#The following indicates that you can read the. htaccess file, or you can configure it directly in the virtual host .allowoverride allrewriteengine Onrewriterule News-id (\d+). html$ error.php?id=$1#you can set multiple overriding rules here.#rewriterule news-id.html$ error.php</Directory> </virtualhost>4. Write in the appropriate directory.htaccess Rewrite rule example:<ifmodule rewrite_module>Rewriteengine Onrewriterule News-id (\d+). html$ show.php?id=$1#you can set multiple overriding rules here.#rewriterule news-id.html$ error.php</IfModule>If you can create it directly under Linux,If you are using Notepad to create a file under the Windows platform, such as Abc.txt,then save as.htaccess files can be5. Rewrite the rules, or you can configure the <Directory> segment of the virtual host directly.

Turn on pseudo-static for PHP

Related Article

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.