Protect Uploads in Multisite

You’ve got some issues in your underlying objective … For example, I have a filed called 40c.jpg located at localhost/files/2011/07/40c.jpg OK, this makes sense and is where the image should be in the first place. I want the file to show up only when called by HTML on the local domain (here: localhost). So not … Read more

How do I skip wordpress’s 404 handling?

Native WordPress rules are designed to ignore any existing files and directories, including arbitrary PHP scripts. This is literally what this part of directives mean: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d So under normal circumstances WP just shouldn’t be involved with your request in any way. You may have some other rewrite rules interfering, possibly … Read more

Nginx rules for subdomain multisite install (Bedrock)

Ok some wise guy deleted my last post. The answer, which the above member (@etc) gave to me on another forum, and is working quite fine, is as follows: # Rewrites for Bedrock Multi-Site Subdomain Setup rewrite /wp-admin$ $scheme://$host$uri/ last; rewrite ^/(wp-.*.php)$ /wp/$1 last; rewrite ^/(wp-(content|admin|includes).*) /wp/$1 last; He revised his answer but did not … Read more

How to add .htaccess code through a function?

/** * Inserts an array of strings into a file (.htaccess ), placing it between * BEGIN and END markers. Replaces existing marked info. Retains surrounding * data. Creates file if none exists. * * @param array|string $insertion * @return bool True on write success, false on failure. */ function add_htaccess($insertion) { $htaccess_file = ABSPATH.’.htaccess’; … Read more

custom htaccess rewrite rule for page

You can do this with WordPress’ built-in rewrite system. function add_video_rewrite() { add_rewrite_tag(“%video_id%”, ‘([^/]*)’); add_rewrite_tag(“%video_src%”, ‘([^/]*)’); add_rewrite_tag(“%video_title%”, ‘([^/]*)’); add_rewrite_rule(‘^video/([^/]*)/([^/]*)/[^/]*)’, ‘index.php?pagename=video&video_id=$matches[1]&video_src=$matches[2]&video_title=$matches[3]’, ‘top’); } add_action( ‘init’, ‘add_video_rewrite’ ); Didn’t test it, but I think this should work. What is does is first adding tags that you can use in your template (get_query_var(video_id)). Then add a rewriterule that … Read more

How disable SSL redirect for specific URL?

Your URL http://domain.com/server should work without problems. Most likely you have activated an HTTPS redirection for your website. You should check: If you have a security or other type of plugin that forces the HTTPS redirection and deactivate the redirection. (Most likely they will edit your .htaccess file in order to force the HTTPS) Check … Read more

Error 101 after upgrading WordPress

Are you sure /wp-includes/load.php made it to the server? If you were installing manually, there’s a chance it got lost during the transfer. Happens to me occasionally using FileZilla. The error messages are basically telling you that the server can’t find the file, so make sure the file is there.

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