add_rewrite_rule results vary
-
I have been trying to use add_rewrite_rule() and am getting different results in different browsers.
The raw wordpress url is:
https://www.devsite.owl55.com/single-community-details/?community=1&property=ST8575820I’d like this to look to the user, like:
https://www.devsite.owl55.com/homes-for-sale/celebrate-by-del-webb/1-ST8575820Defined as:
https://www.devsite.owl55.com/homes-for-sale/<dummy data>/<community>-<property>In the themes functions.php I’ve added:
add_action('init','mysite_rewrite_rules'); function mysite_rewrite_rules(){ add_rewrite_rule('^homes-for-sale/([-a-zA-Z0-9]*)/([0-9]{1,2})-([A-Z0-9]*)$','single-community-details/?community=$matches[2]&property=$matches[3]','top'); flush_rewrite_rules(false); }
When I visit the raw URL in any browser (Firefox, IE, Chrome) it looks fine.
If I visit https://www.devsite.owl55.com/homes-for-sale/celebrate-by-del-webb/1-ST8575820 with firefox, the URL is changed (301 rewrite maybe) to the raw URL, and it loads. I’d like it to stay as it was.
If loaded in Chrome, or IE, all I get is a WordPress 404 error page.
It doesn’t seem to be a caching problem of any kind, but that still wouldn’t surprise me.
- The topic ‘add_rewrite_rule results vary’ is closed to new replies.