This is not how rewrite_rules
works in WordPress.
You miss two things.
- Match. It has
$1
, but in reality (take a look to example), you need to work with$matches
. - Your Query Var. You using
q
, but its not wp native or declared in example code. You can use one of the public ones or declare your query var and logic behind it. - If you are OK with Regular Expressions and already implemnt first two changes, but it still doesn’t work – I would suggest to use debug bar and my plugin debug bar rewrite rules
Related Posts:
- htaccess rewrite conflict with wordpress rules and ssl
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- WordPress site displaying 404 for any page apart from index
- .htaccess Rewrite URL WordPress
- Redirect main domain to subdirectory
- different child theme for subdomain
- Struggling with add_rewrite_rule
- .htaccess rewrite rule puzzle
- need a help for modify .htaccess rule [closed]
- Best way to redirect site in subdirectory to root?
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- TimThumb & htaccess : clean url
- What to write in the htaccess in order to detect browser language and point accordingly?
- want to rewrite an URL in wordpress
- How to turn this .htaccess rule into a dynamic rule with add_rewrite_rule, et al?
- htaccess problem not being able to overwrite previous rules
- add_rewrite_rule to remove /category/ from permalink
- Relative links stop working after moving wordpress site from hosting to localhost
- htaccess redirect throws an error: PHP Catchable fatal error: Object of class WP_Error could not be converted to string
- Rewrite Rules not redirecting rewrite
- Rewrite URL in address bar for a specific page [closed]
- How do I reset a rewrite?
- Rewriting subfolders to specific parent folder in WordPress
- Redirect default pagination page to template page’s pagination
- Remove subdirectory from links
- How to properly give WordPress its own directory
- Rewrite rules and maintain URL
- Giving WordPress it’s own directory and using .htaccess Directory Index
- rewrite rule on plugin activation
- .htaccess rewrite rule stopped working for wordpress site after moving server
- WordPress + Magento .htaccess ReWriteRule Issue (www vs. non-www)
- Custom rewrite rules are sending everything to index.php
- Admin-Ajax.php, SSL, Non-SSL
- How to avoid wordpress permalink rules to inherit in a sub-folder
- Cant block wordpress readme files
- WordPress keeps deleting .htaccess file
- Prevent users from browsing through the media galleries
- How to modify the .htaccess to force ssl on login and admin pages
- WordPress URL/Folder ReWrite using Htaccess
- Why specific file directory fails to redirect but its parent folder succeeds?
- .htaccess redirects no longer work
- Exclude subfolder from WP-redirect works with html but not php files
- Server crashed trying to restore wordpress multisite, images are not found pls help
- Create subdomain masking for each user in WordPress
- Redirect from different port to subdomain – htaccess
- hard flush_rewrite_rules() not regenerating .htaccess
- WordPress Redirect 301 register page
- Only expose routes with prefix /wp-json on WordPress using Apache
- WordPress rewrite rules don’t need ^?
- Permalinks: Page Not Found
- Hardening wordpress: blocking /includes with htaccess
- Install a Network under a mapped domain
- htaccess – RewriteRule without redirect not working
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- Modify the .htaccess file
- blocking access to all post/tag URIs via htaccess
- How do I add /blog/ as a prefix to permalink structure for posts, categories & tags?
- sitemap contains weird links and does not contain my pages [closed]
- how to redirect 301 my old search query string to wordpress search query string?
- Redirections and rewrites to subdomain
- How to block access to files without modifying .htaccess or ngnix config? [closed]
- Allow REST API over HTTP, the rest of the site forced to HTTPS
- Trouble adding directory rewrite to htaccess under wordpress [closed]
- Conflict with Force SSL and Rewrite Rules
- Help with multisite redirect issues using Cherokee OR solid nginx config?
- How to rewrite 404 to home page using htaccess?
- Custom url rewriting
- Redirect htaccess [closed]
- “Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- HTTPS to HTTP rewrite rules not working as expected
- VServer/Rootserver/Shared Hosting: Multiple WordPress installations each having their unique domain?
- How do I make WordPress revise an .htaccess file a certain way?
- Add rewrite rule to make Woocommerce product category page seo friendly
- Sub domain URL slash / missing after domain and before Post & page slug
- Problem with WordPress permalinks
- I need to make one folder private
- Force HTTPS for mapped domain pointing to wordpress domain
- How can I restrict access, by IP, to the `wp-admin` folder/Dashboard?
- After changing permalink, getting 404 for one particular category
- My permalinks for all pages and posts now include old page titles as parents/categories
- WordPress Intercepting Requests To A File In Public HTML
- Htaccess remove dates from root site but not from subdomain
- .htaccess home configuration
- Installing wordpress on subdirectory 2 levels down
- Cannot Override WordPress 404 for a Sub-Directory
- adding a rewrite rule in wordpress functions file
- Multisite permalinks for subfolder wordpress installation
- Missing visual editor after placing a redirect rule into the .htaccess file
- Redirect not working
- Permanently Redirect WordPress Subfolder Blog to Subdomain on Another Server
- WordPress site not redirecting properly
- Additional .htaccess rules based on wp page
- .htaccess for Subdomain and Subfolder w/SSL
- Why my wp site always redirecting to the old website path..?
- Hiding wp-config.php via .htaccess on an install installed in another directory?
- Standard Htaccess directives disappear by themselves
- How To Add CSP frame ancestors in WordPress Website? [closed]
- The connection to “domain” is not secure
- How do I modify each instance of setcookie?