


Turn on PHP pseudo-static, turn on PHP pseudo-static_PHP tutorial
Enable PHP pseudo-static, enable PHP pseudo-static
1. Check whether Apache supports mod_rewrite
View the environment configuration through the phpinfo() function provided by php, and use Ctrl F Find "Loaded Modules", which lists all modules that
apache2handler has enabled. If "mod_rewrite" is included, it is already supported and no further settings are required.
If "mod_rewrite" is not enabled, open the httpd.conf file
under your apache installation directory "/apache/conf/" and use Ctrl F to find "LoadModule rewrite_module" ”, just delete the “#” sign in front.
If it is not found, go to the "LoadModule" area, add "LoadModule rewrite_module modules/mod_rewrite.so" in the last line (required to be an exclusive line), and then restart the apache server.
2. Configure virtual host in httpd.conf
# Virtual hosts Enable virtual host
Include conf/extra/httpd-vhosts.conf
3. In the httpd_vhosts.conf file, configure the corresponding options. Detailed explanation
DocumentRoot "C:/myenv/apache/htdocs/static3"
ServerName www. hsp.com
#Deny from All 403 error message
Allow from All
#If the file directory is outside the apache directory , comment out optinos, it cannot be listed.
options Indexes
#The following means that you can read the .htaccess file, or you can configure it directly in the virtual host.
Allowoverride All
RewriteEngine On
RewriteRule news-id(d).html$ error.php?id=$1
#You can set multiple rewrite rules here
#RewriteRule news-id.html$ error.php
< /Directory>
4. Write .htaccess rewrite rules in the corresponding directory
Example:
RewriteEngine On
RewriteRule news-id(d).html$ show.php?id=$1
#You can set multiple rewrite rules here
#RewriteRule news-id.html$ error .php
If it can be created directly under Linux,
If it is under Windows platform, use Notepad to create a file, such as abc.txt, and then save it
Just .htaccess file
5. Rewrite rules can also be configured directly in the

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.
