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.

  1. make sure have rewrite engine on in apache configuration
  2. login wordpress administrative rights , go settings -> permalinks shown attached 3 images. enter image description here
  3. if permalink not updated, don't have write access root of website or rewrite module of apache not enabled.
  4. 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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -