I have a one-page wordpress site. It uses pages and posts but is all programatically included in the core template. I don't want users to ever accidentally access a single posts (even though it's unlikely that would ever happen). I would prefer to not have to use a 404 template either so it would be great to redirect EVERY page to the home page. Is this easily done without interfering with the default .htaccess rules?
相关问题
- Display product ACF field value in Woocommerce tra
- Backbone.js PushState routes .htaccess only workin
- Stop .htaccess redirect with query string
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
相关文章
- wordpress新增页面如何个性化设置
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- Woocommerce update shipping methods in checkout vi
- Change order status just after payment in WooComme
- Publishing or uploading failed. Error message: “Th
- Multiple htaccess rewrite rule
- Facebook Login With WP JWT Auth
I ended up using this plugin and redirecting each page manually, thus leaving irrelevant pages to throw a 404 error. It's not what I wanted but in the end it's best practice.
Add this line of code to your htaccess file:
redirect 301 / http://www.yoursiteurl.com/
Replace "yoursiteurl" with your actual domain.
Try using this plugin. It allows redirection of all URLs.