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=$1
This URL,[]
It is optional.