php - Wordpress custom permalinks using .htaccess -
currently added custom structure posts premalinks /post/%post_id% through permalinks settings in admin.
since need rewrite permalinks categories, tags , author pages follow:
categories
current /post/category/category_name /category_name
tags
current /post/tag/tag_name tag/tag_name
author
current /post/author/author_username /author/author_username
i tried create custom rewriterule in .htaccess, didn`t work @ all:
rewriterule ^/([^/]*)$ ./post/category/$1 [l] rewriterule ^/tag/([^/]*)$ ./post/tag/$1 [l] rewriterule ^/author/([^/]*)$ ./post/auhtor/$1 [l] any .htaccess rules coding achieve such permalinks appreciated.
- make sure have rewrite engine on in apache configuration
- login wordpress administrative rights , go settings -> permalinks shown attached 3 images.

- if permalink not updated, don't have write access root of website or rewrite module of apache not enabled.
- if permalink message appears, means created .htaccess in root of wordpress site.
this way can achieve following url formats:
categories
category/category_name tags
tag/tag_name author
/author/author_username note: best practice prefix url category, /category prefix should added path rather directly accessing because wordpress have page , post accessed directly without prefix generally.
Comments
Post a Comment