如何在WordPress中以这种方式重写URL?
- 我的主要逻辑页面是在“ site.com/main-page/”。
- 我需要的是:访问者可以请求任何URL(不是现有的物理文件或文件夹),而当他们在浏览器地址栏中看到所请求的URL时,这些内容是从我们的主处理页面上提供的,请访问“ site.com/main” -page/“”
- 在.htaccess中添加此行无效,并且访问者会遇到404错误。
RewriteRule ^.$ /main-page/ [L] #custom line added
RewriteRule ^index\.php$ - [L] #default code by WP. Custom code added above this line.
WordPress中有哪些替代方案可以实现我需要的东西?
谢谢。
– My main logic page is at “site.com/main-page/”.
– What I need is: A visitor can request whatever URL (not an existing physical file or folder) and while they see their requested URL in their browser address bar, the content is served from our main processing page at “site.com/main-page/”
– Adding this line in .htaccess did not work and visitors get a 404 error.
RewriteRule ^.$ /main-page/ [L] #custom line added
RewriteRule ^index\.php$ - [L] #default code by WP. Custom code added above this line.
What are the alternatives available in WordPress to achieve what I need?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论