简体   繁体   中英

Wordpress static home page dynamic posts page url rewrite

Hi I have a Wordpress installation with a static main page and posts page with the name articles.

My custom permalink string within Wordpress is set to /%postname%

and my htaccess file is set as follows:

 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ./index.php [L]
 </IfModule>

When I browse to the articles page, my url rewrite looks like this:

example.com/articles/page/5

EDIT ----- The articles page is the one that I use to browse all articles with a previous article and a next article link.

Thus next article would give me example.com/articles/page/6 and previous article would bring me to example.com/articles/page/4

however I would like the "page" part to change to article and the "number" to the actual particle name. EDIT ------ END

I would like to get a setting as follows:

example.com/articles/article/the-article-name

how would I achive this?

Try a trailing slash on your permalink setting: /%postname%/

Edit 5/02/10:

Check your .htaccess for multiple, conflicting rewrite blocks.

If want this: /articles/article/name-of-article

The set "articles" as your category base and put all articles in a category called "article":

Posts Categories SubPanel « WordPress Codex

And then your paging will be in the format page/2/, etc.

If all your posts are essentially 'articles' (ie you don't mind having 'articles' in the URL for all post-related permalinks - categories, tags, single posts etc.), then simply set your permalink structure to;

/articles/%category%/%postname/

Obviously if you want the structure articles/article/post-name/ , you'll have to file posts in a category with slug 'article'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM