我從apache 2.2移動到2.4,但在.htaccess中的代碼RewriteRule ^(pl)($|/) - [L]
現在不工作。我嘗試了幾乎所有的東西,但是我仍然無法完成它的工作。
有人可以幫忙嗎?請
我從apache 2.2移動到2.4,但在.htaccess中的代碼RewriteRule ^(pl)($|/) - [L]
現在不工作。我嘗試了幾乎所有的東西,但是我仍然無法完成它的工作。
有人可以幫忙嗎?請
htaccess的根:在PL DIR
RewriteEngine On
RewriteRule ^(pl)($|/) - [L]
RewriteCond %{HTTP_HOST} ^([a-z.]+)?myweb\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .? http://www.myweb.com%{REQUEST_URI} [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
的htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
這應該被添加問題而不是答案。 – anubhava
這/pl/
目錄應該是htaccess的:
RewriteEngine On
RewriteBase /pl/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
非常感謝,它工作正常。我認爲這個問題可能只在根目錄。 – user3540265
很高興知道它已經解決了,[您可以點擊答案左上角的勾號**標記答案](http://meta.stackexchange.com/a/5235/160242) – anubhava
首先確保的.htaccess (Accessfile)已啓用,默認情況下已禁用。檢查這個鏈接http://webmasters.stackexchange.com/questions/61009/how-to-enable-use-of-htaccess-in-apache-on-ubuntu – Oxi
你也應該解釋一下這條線的意思。 。你的意思是「不工作」。例如: – arkascha
:我有這個網址mydomain.com/pl/some-article/,現在它使用根.htaccess規則,我需要它只使用來自dir mydomain.com/pl/的.htaccess規則。部分「some-article /」只是虛擬的......在「pl」目錄中是另一個WP安裝 – user3540265