How do I implement conditions for wp_rewrite?
-
I need a non-wp re-write rule to be installed by wp for my plugin.
it should help a series of files to be found by the client even when requested to be in the wrong location. Kind of an application being found in your computer.
E.g. Given the file to be found will be always at:
https://www.mydomain.com/here/findme1.html
https://www.mydomain.com/here/findme2.htmlI need to test whether the url contains “here/findme” and return the right url if it doesn’t.
Such incorrect request is not fixable, so moving on, I have created a redirect rule that needs to be added to .htaccess by wp the first time the plugin is run.
How do I tell wp to add the conditional before the rule?
It should write in .htaccess the following:
(I ignore how in Windows server. I’ll research how wp manages redirections in windows)RewriteCond %{REQUEST_URI} !here RewriteRule ^.*findme(.*)$ /here/findme$1 [R=301,L]
Thanks.
- The topic ‘How do I implement conditions for wp_rewrite?’ is closed to new replies.