usagizmo
12/20/2017 - 11:16 AM

mod_rewrite sample

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/en/inquiry/.*$
RewriteCond %{REQUEST_URI} !^/cn/inquiry/.*$
RewriteRule ^en/(.*?)$ http://%{HTTP_HOST}/en/$1 [L,R=302]
RewriteRule ^zh/(.*?)$ http://%{HTTP_HOST}/cn/$1 [L,R=302]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^jp/company/links.html$ https://%{HTTP_HOST}/ja/company/agency/ [L,R=301]
RewriteRule ^jp/company/QualityPolicy.html$ https://%{HTTP_HOST}/ja/company/qualitypolicy/ [L,R=301]
RewriteRule ^jp/product/$ https://%{HTTP_HOST}/ja/product/brand/ [L,R=301]
RewriteRule ^jp/product/new.html$ https://%{HTTP_HOST}/ja/product/ [L,R=301]

RewriteRule ^jp(.*?).html$ https://%{HTTP_HOST}/ja$1/ [L,R=301]
RewriteRule ^jp(.*?)$ https://%{HTTP_HOST}/ja$1 [L,R=301]
</IfModule>