Need to make a php file inside theme accessible via url

Ok here is a test working solution: <?php /* Plugin Name: wpse26719 Plugin URI: http://en.bainternet.info Description: Need to make a php file inside theme accessible via url Version: 1.0 Author: Bainternet Author URI: http://en.bainternet.info */ // Register a URL that will set this variable to true add_action(‘generate_rewrite_rules’, ‘wpse26719_rw’); function wpse26719_rw($wp_rewrite) { $newrules = array(); $new_rules[‘^adserver.js.php$’] … Read more

Removing rules from .htaccess

Problem 1 Your hook ci_add_rules() will still run when you flush rules, so remove it first (and avoid “unsetting” non_wp_rules, you’ll break other plugins that make use of it). function ci_remove_rules() { remove_action( ‘generate_rewrite_rules’, ‘ci_add_rules’ ); $GLOBALS[‘wp_rewrite’]->flush_rules(); } Problem 2 Pretty sure you want: plugin_dir_url( ‘proxy.php’, __FILE__ ) ..instead of: plugin_dir_path( __FILE__ ) . ‘proxy.php

Bypass .htaccess when using download_url

You can inject a made-up referer into WordPress’ HTTP request by filtering pre_http_request. All you need is a simple class like this (untested!): class FakeWpReferer { private $referer; private $url; private $is_regex; /** * @param string $referer * @param string $url URL to fake the referer for. * @param bool $is_regex Is $url a regular … Read more

Remove year and month in URL using .htaccess

Assuming you have already changed the permalinks structure as @RickHellewell suggests, then you can do something like the following near the top of your .htaccess file (before the existing WP front-controller) to redirect the old URLs (with the stated format) in order to preserve SEO. RewriteRule ^\d{4}/\d\d/([a-z-]+\.html)$ /$1 [R=301,L]

Without index.php in permalinks I get 404 across site

Adding junk doesn’t do anything either. That suggests your .htaccess file is not being processed at all. You need to set AllowOverride All in the appropriate <Directory> container in the main server config (or <VirtualHost> container) to enable the parsing of per-directory .htaccess files (to allow .htaccess directives to override the server config). The FollowSymLinks … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)