WordPress .htaccess file gives issues with subdirectory
WordPress .htaccess file gives issues with subdirectory
WordPress .htaccess file gives issues with subdirectory
Try this and follow the same structure to add more rewrite rules or query vars: add_filter(‘query_vars’, ‘my_query_vars’); function my_query_vars( $vars) { $vars[] = “land”; $vars[] = “expert”; return $vars; } // Add the new rewrite rule to existings ones add_action(‘init’,’my_rewrite_rules’); function my_rewrite_rules() { add_rewrite_rule( ‘land/(.+)/?$’ , ‘index.php?land=1&expert=$matches[1]’ , ‘top’ ); } Don’t forget to flush … Read more
Multisite install w/ Sub domains on a subdomain
htaccess getting overwritten over and over = 404 error
I am not sure why this happens, but you can stop all write access to your .htaccess with a simple filter: add_filter( ‘flush_rewrite_rules_hard’, ‘__return_false’ ); Neither WordPress nor any plugins calling flush_rewrite_rules() will write something into the file now. Other methods to access and change the file will still work, for example insert_with_markers().
You could try redirecting without a plugin, using the .htaccess file. This file can be found at wordpress root folder, if all you want to do is redirect this specific page, you could open and insert the following line (at the first line of the .htaccess) Redirect 301 /2014/02/20/events-2014/ http://www.example.com/2014/03/02/events-2014/
Adding this directive at the beginning of the .htaccess file should do the trick: DirectoryIndex index.php If this doesn’t do the trick, try creating an .htaccess file in the wp-admin folder and place this directive in there (depending on what HTTP server your system runs on and a variety of other settings, modifying just the … Read more
This is not quite trivial, because natively WP is engineered to completely ignore requests to existing files. So WP doesn’t pay attention to files and .htaccess doesn’t have access to WP’s logged in information. If you look for prior art (in plugins for selling digital files for example) this isn’t easily (at all?) doable with … Read more
Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
Accessing Subdirectories in WordPress Install