这个没测试过,最好是修改vhosts,不过可以使用perdir .htaccess:
在 /.htaccess 中,我们可以添加:
RewriteCond ${REQUEST_FILENAME} !-d
RewriteCond ${REQUEST_FILENAME} !-f
RewriteRule ^wp-admin/for-buyers/$ /wp-admin/admin.php?page=for_buyers [L]
RewriteCond ${REQUEST_FILENAME} !-d
RewriteCond ${REQUEST_FILENAME} !-f
RewriteRule ^wp-admin/for-buyers/marketing-materials/$ /wp-admin/admin.php?page=marketing_materials [L]
此规则集执行此操作:
- http://www.website.com/wp-admin/for-buyers/ => /wp-admin/admin.php?page=for_buyers
- http://www.website.com/wp-admin/for-buyers/marketing-materials/ => /wp-admin/admin.php?page=marketing_materials
或在 /wp-admin/.htaccess 中:
RewriteCond ${REQUEST_FILENAME} !-d
RewriteCond ${REQUEST_FILENAME} !-f
RewriteRule ^for-buyers/$ /wp-admin/admin.php?page=for_buyers [L]
RewriteCond ${REQUEST_FILENAME} !-d
RewriteCond ${REQUEST_FILENAME} !-f
RewriteRule ^for-buyers/marketing-materials/$ /wp-admin/admin.php?page=marketing_materials [L]