针对特定 url 在 htaccess 上禁用重定向

Disable redirect on htaccess for specific url

我有 htaccess 和一些重定向, 我想 avoid/disable/not 重定向挂钩中使用的特定 URL 以通过 POST 发送数据,这些 URL 是:

https://www.example.com/index.php?route=zoho/product/autoAdd
https://www.example.com/index.php?route=zoho/product/autoUpdate
https://www.example.com/index.php?route=zoho/product/autoDelete


htaccess 执行以下操作:
1- 将 http 重定向到 https
2- 将非 www 重定向到 www
3- 从 url

中删除 index.php?route



htaccess:

<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>

RewriteEngine On
RewriteBase //
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_= [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteCond %{REQUEST_URI} !^index.php?route=zoho/product.*$
RewriteRule ^([^?]*) index.php?_route_= [L,QSA]
RewriteCond %{THE_REQUEST} \ /+index\.php\?_route_=([^\ &]+)
RewriteRule ^ /%1? [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/ [L]


<IfModule mime_module>
  AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^/?$ "https\:\/\/www\.example\.com\/" [R=301,L]


<IfModule php7_module>
   php_value default_charset "UTF-8;"
   php_value memory_limit 2048M
   php_value max_execution_time 64000
   php_value upload_max_filesize 999M
   php_value mysql.connect_timeout 20
   php_flag session.auto_start Off
   php_flag session.use_only_cookies On
   php_flag session.use_cookies On
   php_flag session.use_trans_sid Off
   php_value session.cookie_httponly "On;"
   php_value session.gc_maxlifetime 3600
   php_flag display_errors Off
   php_value max_input_time 6000
   php_value max_input_vars 6000
   php_value post_max_size 4096M
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_value default_charset "UTF-8;"
   php_value memory_limit 2048M
   php_value max_execution_time 64000
   php_value upload_max_filesize 999M
   php_value mysql.connect_timeout 20
   php_flag session.auto_start Off
   php_flag session.use_only_cookies On
   php_flag session.use_cookies On
   php_flag session.use_trans_sid Off
   php_value session.cookie_httponly "On;"
   php_value session.gc_maxlifetime 3600
   php_flag display_errors Off
   php_value max_input_time 6000
   php_value max_input_vars 6000
   php_value post_max_size 4096M
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_flag zlib.output_compression Off
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/ [L,R=301]

RewriteEngine On 下方插入此规则以忽略 POST 请求的所有规则:

RewriteEngine On

RewriteCond %{REQUEST_METHOD} POST
RewriteRule ^ - [L]

# remaining rules go below this line