首页 > 解决方案 > .htaccess 重写代码阻止我编辑 wp 页面

问题描述

我的 .htaccess 包含以下代码,该代码不允许我编辑我的 wordpress 网站页面。

  `<IfModule mod_rewrite.c>`  

      `RewriteEngine On`
     `RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]`

    `RewriteBase /`

      # Force Trailing Slash

       `RewriteCond %{REQUEST_FILENAME} !-f`

       `RewriteCond %{REQUEST_URI} ^(.*)[^/]{1}$`
       `RewriteRule (.*) $1/ [L,R=301]`

      # Rewrite HTTP to HTTPS
       `RewriteCond %{HTTPS} !=on`
       `RewriteRule (.*) https://example.com/$1 [L,R=301]`

       `RewriteRule ^index\.php$ - [L]`
       `RewriteCond %{REQUEST_FILENAME} !-f`
       `RewriteCond %{REQUEST_FILENAME} !-d`
`RewriteRule . /index.php [L]`



`</IfModule>`




# END WordPress
`RewriteEngine On`
`RewriteCond %{HTTPS} off [OR]`
    
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
`<IfModule mime_module>`
  `AddHandler application/x-httpd-ea-php73 .php .php7 .phtml`
`</IfModule>`
# php -- END cPanel-generated handler, do not edit

我注意到,在我删除 #Force Trailing Slash 和 #Rewrite HTTP to HTTPS 的代码并保存 .htaccess 文件后,我可以编辑我的 wp 页面。但我不想删除这些代码,因为它会强制整个站点使用 https 并在末尾使用斜杠。

请有人建议我最好的选择。

标签: wordpress.htaccess

解决方案


推荐阅读