跳过导航

本主题包含 0 則回覆 ,有 0 声音 。

最后由 davideM-62 4 months, 1 weeks前 更新。

协助者:: Kor.

作者 帖子
6 2 月, 2025 于 7:21 下午 #16676977

davideM-62

Background of the issue:
I am trying to prevent WPML from rewriting the htaccess file, which causes the website to go down. The original htaccess configuration is:

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteRule ^en/wp-login.php /wp-login.php [QSA,L]
RewriteRule ^it/wp-login.php /wp-login.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

It changes to:

# BEGIN WordPress
# Le direttive (linee) tra "BEGIN WordPress" e "END WordPress" sono
generate dinamicamente, e dovrebbero essere modificate solo tramite i filtri di WordPress.
# Ogni modifica alle direttive tra questi marcatori verrà sovrascritta.

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /it/
RewriteRule ^index.php$ - [L]
RewriteRule ^en/wp-login.php /it/wp-login.php [QSA,L]
RewriteRule ^it/wp-login.php /it/wp-login.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /it/index.php [L]

# END WordPress

Link to a page where the issue can be seen: 隐藏链接

Symptoms:
The website goes down and doesn't work anymore after WPML rewrites the htaccess file.

Questions:
Is it possible to have WPML stop rewriting the htaccess file?