Wordpress missing blog permalink

為{幸葍}努か 提交于 2019-12-02 03:55:29

This should work for you (changing the www.domain.com to your domain) :

Options -Indexes +SymLinksIfOwnerMatch
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/blog/

# Don't apply to URLs that go to existing files or folders
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all those to insert /blog
RewriteRule ^(.*)$ http://www.domain.com/blog/$1 [L,R=301]

EDIT: This will rewrite specific urls:

RewriteEngine On
RewriteRule ^blog-post1$ http://www.example.com/blog/blog-post1 [R=301,L]
RewriteRule ^blog-post2$ http://www.example.com/blog/blog-post2 [R=301,L]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!