如何删除htaccess的URL的一部分

问题描述 投票:-2回答:1

我想在我的博客使用.htaccess网址只有最后一部分。

https://example.com/blog/category1/category2/postname1
https://example.com/blog/category1/postname2

我想有只:

https://example.com/blog/postname1
https://example.com/blog/postname2
php linux .htaccess
1个回答
-1
投票

用户RewriteRule规则 该规则将像..

RewriteRule ^([a-zA-Z0-9-]+)$  blog/postname1?slug=$1 [L]

检查这个网址: - How to rewrite url with post title slug?

© www.soinside.com 2019 - 2024. All rights reserved.