How to redirect every request to a single page.
-
I’m working on a marketing website. My requirement is that except for a few pages, every request like https://hirisemarketing.com/<anything> will redirect to a page (which I’ve already created through wp admin) https://hirisemarketing.com/marketing. This page has a shortcode which lets me create a full-fledged dynamic code through a plugin.
Everything is good except i am unable to do the redirection. I have created rewrite rules for some of the pages as per my needs like this:
add_rewrite_rule('ads/([^/]+)?$', 'index.php?pagename=ads&adct=$matches[1]', 'top'); add_rewrite_rule('renew/([^/]+)?$', 'index.php?pagename=renew&arcd=$matches[1]', 'top'); add_rewrite_rule('image-gallery/([^/]+)?$', 'index.php?pagename=image-gallery&adpid=$matches[1]', 'top');
They are all working fine. But here I want to create the redirection as i mentioned above. I’ve tried many possibilities like:
add_rewrite_rule('([^/]+)?$', 'index.php?pagename=marketing&bizpermalink=$matches[1]', 'top');
but no luck. Please help!
Thanks,
baburman
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to redirect every request to a single page.’ is closed to new replies.