此特定代码适用于一台服务器,但不适用于另一台服务器。工作的有 Apache2,另一个 Apache1。我怎样才能使它在两者上都起作用?
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# SEO translation
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?:[a-z]{2}/)?.*-p-([0-9]+)$ page.php?page_id=$1&%{QUERY_STRING}
RewriteRule ^(?:[a-z]{2}/)?(.*) $1?%{QUERY_STRING}
</IfModule>
输入 URL 备选方案:
- www.domain.com/some-fancy-title-p-10
- www.domain.com/en/some-fancy-title-p-10
- www.domain.com/sv/some-fancy-title-p-10