我想从网站的 url 中删除“文章”和“人工”文件夹,但是当我尝试将重写规则引入 .htaccess 文件时,我收到错误消息。
http://www.example.com/articles/artificial/are_string_beans_all_right_on_the_candida_diet.php
试图转换
http://www.example.com/are_string_beans_all_right_on_the_candida_diet.php
这是我的 .htaccess 文件的当前版本
DirectoryIndex index.php
AddDefaultCharset utf-8
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php/?$ / [L,R=301,NC]
RewriteRule ^((?!articles/artificial).*)$ articles/artificial/$1 [NC,L]