How can I ignore the. htaccess file? Whining ~

Source: Internet
Author: User
Good Morning, everyone. I found that the file didn't work when I used the. htaccess file to rewrite the url. Below are some of my operations. please help me to see what went wrong. Thank you! Modify httpd. conf: 1. remove & quot; LoadModuleRewrite_modulemodulesm...

Good Morning, everyone. I found that the file didn't work when I used the. htaccess file to rewrite the url. Below are some of my operations. please help me to see what went wrong. Thank you!

Modify httpd. conf as follows:
1. remove the # before "LoadModule Rewrite_module modules/mod_Rewrite.so #
2. change "AllowOverride None" to "AllowOverride All"
3. set "AccessFileName. htaccess"

Because the textbook I learned is "deep understanding of php: advanced skills, object-oriented and core technologies", I use the relevant code. the url format of my website is as follows:

The. htaccess file code provided by the textbook is as follows:


  
   
RewriteEngine on # The following path I have modified RewriteBase/RewriteRule ^ (about | contact | this | that | search )/? $ Index. php? P = $1
  

As expected, the url should be in the following format:

However, the results have not changed. I found some posts on the internet about ". htaccess is invalid" and they did not solve my problem. Therefore, please come here to help me with my advice.

Tip:
When I intentionally write the path after RewriteBase in the. htaccess file, error 500 is displayed on the page. in my opinion, this indicates that the. htaccess file is not loaded, but the code is faulty.

Reply content:

Good Morning, everyone. I found that the file didn't work when I used the. htaccess file to rewrite the url. Below are some of my operations. please help me to see what went wrong. Thank you!

Modify httpd. conf as follows:
1. remove the # before "LoadModule Rewrite_module modules/mod_Rewrite.so #
2. change "AllowOverride None" to "AllowOverride All"
3. set "AccessFileName. htaccess"

Because the textbook I learned is "deep understanding of php: advanced skills, object-oriented and core technologies", I use the relevant code. the url format of my website is as follows:

The. htaccess file code provided by the textbook is as follows:


  
   
RewriteEngine on # The following path I have modified RewriteBase/RewriteRule ^ (about | contact | this | that | search )/? $ Index. php? P = $1
  

As expected, the url should be in the following format:

However, the results have not changed. I found some posts on the internet about ". htaccess is invalid" and they did not solve my problem. Therefore, please come here to help me with my advice.

Tip:
When I intentionally write the path after RewriteBase in the. htaccess file, error 500 is displayed on the page. in my opinion, this indicates that the. htaccess file is not loaded, but the code is faulty.

??? You understand it. the rewrite rule islocalhost/about[/]This URL becomesindex.php?p=$1This URL,[]It is optional.

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.