简体   繁体   English

如何使用自定义分类法和自定义帖子类型在 wordpress 中制作短网址?

[英]How to make short url in wordpress with custom taxonomy and custom post type?

I had a struct like this:我有一个这样的结构:

http://example.com/products-category/products/vietnamese-hair/single-drawn-hair/ http://example.com/products-category/products/vietnamese-hair/single-drawn-hair/

How can I make this URL shorter, like: http://example.com/vietnamese-hair/single-drawn-hair ?如何缩短此 URL,例如: http://example.com/vietnamese-hair/single-drawn-hair

EDIT: Here is my .htaccess file:编辑:这是我的 .htaccess 文件:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^unsubscribe/$ /wp-content/plugins/email-newsletter/unsubscribe/unsubscribe.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^unsubscribe/$ /wp-content/plugins/email-newsletter/unsubscribe/unsubscribe.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WordPress自定义帖子类型和分类 - WordPress Custom Post Type and Taxonomy WordPress URL重写以同步自定义分类法和帖子类型 - Wordpress URL Rewrite to sync custom taxonomy and post type 在WordPress网站中显示带有URL的自定义帖子类型分类法 - Show custom post type taxonomy with URL in WordPress site Wordpress自定义帖子类型中的自定义分类法未显示 - custom taxonomy in wordpress custom post type not showing 如何在Wordpress中使用2个自定义分类法和Ajax过滤自定义帖子类型的列表 - How to filter list of custom post type with 2 custom taxonomy with ajax in wordpress 在Wordpress中显示自定义帖子类型分类的页面 - Display page of custom post type taxonomy in Wordpress 使用Wordpress短代码获取自定义帖子类型/分类 - Fetching custom post type/taxonomy with Wordpress shortcode Wordpress 自定义帖子类型和分类模板文件 - Wordpress custom post type and taxonomy template file Wordpress 过滤自定义帖子类型分类 - Wordpress filtering custom post type taxonomy 如何在WordPress中实现URL结构,例如“网站名称/存档页面/类别(或自定义分类法/自定义帖子类型)”? - How to achieve URL structure like “website-name/archive-page/category(or custom taxonomy)/custom-post-type” in WordPress?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM