admin管理员组

文章数量:1279186

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 3 years ago.

Improve this question

I recently encountered what I thought was curious behavior from WooCommerce Products in that the URL redirected when the incorrect directory was specified.

Background

The product base permalink is set to 'product' in settings > permalinks so that if a product called 'sample' is added then the URL is automatically set as /.

All of this works fine. However, if I enter the URL '/' into the browser and I do not have a page called 'sample', then this automatically redirects to /. In fact if I enter any directory name like '/' into the browser then it redirects to /.

I then tried this on a Wordpress page where the parent directory was specified in the page definition e.g. / and again if I enter / then this redirects to /.

This appears to be standard Wordpress functionality that I never noticed until now, but I cannot find any information on-line about this feature not can I find if there is some way to turn this off so that there is no auto-redirect. Any suggestions or insights will be welcomed.

本文标签: redirectWooCommerce unexpected behavior