How to add “page/” prefix to standard WP static pages?
How to add “page/” prefix to standard WP static pages?
How to add “page/” prefix to standard WP static pages?
Rewrite rule for nested URL does end in 404
I encountered the same issue on a client project. If you haven’t already, you’ll need to add the query variable as a public query variable otherwise using get_query_var() won’t work properly. /** * Adds the query var to public vars, making it accessible. */ add_filter(‘query_vars’, ‘query_vars’); function query_vars($public_query_vars) { $public_query_vars[] = ‘custom_route’; return $public_query_vars; } … Read more
WordPress rewrite rule – not able to access second and third parameters
rewriteRules WP6
Direct domain alias to a specific WordPress page without the page in the URL
Rewrite rule to index.php in theme subfolder
I found some documentation here. It looks like this is accessed when saving the permalink settings under Settings->Permalinks. It looks like this works in conjunction with the rules stored in .htaccess.
This isn’t strictly a WP question, but this should work – not necessarily the most efficient representation though: RewriteRule ^(.*mytheme/)pdf.php http://mysite.com/pdf This (http://martinmelin.se/rewrite-rule-tester/) is a very useful site for testing rewrite rules.
Your external rule doesn’t work because you’re using a format that only works for internal rules- $matches[1] is essentially nonsense in the context of an .htaccess file. Using the $matches array will only work when rules are parsed by PHP, external rules need to use the standard $1 instead of $matches[1]. Any rule that doesn’t … Read more