在Wordpress(或.htaccess)中设置URL别名

在Wordpress(或.htaccess)中设置URL别名

问题描述:

我有一个在Wordpress上运行的网站,我想创建一个自定义的短网址.

I have a site running on Wordpress, and I want to create one custom short-url.

如果页面URL是www.mysite.com/category/post,我希望用户能够访问www.mysite.com/alias

If a page URL is www.mysite.com/category/post I want the user to be able to visit www.mysite.com/alias

如果有一种"Wordpress-y"处理方式,那就更好了,但是我也可以通过修改.htaccess文件来做到这一点.

If there is a 'Wordpress-y' way of doing things, that would be preferable, but I am also able to do it by modifying the .htaccess file.

谢谢

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^alias$ category/post [R=301,L]
</IfModule>