Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file

RewriteCond %{HTTP_COOKIE} !.*wordpress_logged_in.*$ [NC] RewriteCond %{REQUEST_URI} ^(.*?/?)purchase.php RewriteRule . https://%{HTTP_HOST}%1/registrationurl [L,QSA] This will result in a 302 (temporary) redirect to /purchaseads//registrationurl – note the double-slash. This double-slash is passed through to the $_SERVER[‘REQUEST_URI’] variable that WordPress uses to route the URL. So, this may result in WP not being able to route the request. You … Read more

Only expose routes with prefix /wp-json on WordPress using Apache

Try the following mod_rewrite directives instead at the top of your root .htaccess file (before the # BEGIN WordPress section): # Reject any user requests that are not prefixed “/wp-json” RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule !wp-json($|/) – [F] Requested URLs that are not prefixed /wp-json (or /wp-json/) are rejected with a 403 Forbidden. The RewriteCond directive … Read more

WordPress 404 on Subdomain

You don’t appear to have allowed .htaccess overrides in the <VirtualHost *:443> container, so .htaccess is effectively disabled. Without .htaccess you’ll naturally get 404s for anything other than the homepage if you are using “pretty” permalinks. (.htaccess is not required for requests to the homepage, since index.php is served by mod_dir which is no doubt … Read more

404 with post name permalinks

I was able to figure out the problem, and for the sake of posterity, I’m posting the answer here. Basically, the new apache2.conf file that was added when I updated my web server had the following lines in it (my document root is /var/www): <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> … Read more

VB.net and WordPress

So I’m wondering if anyone might know how I could use VB.net for my calculators on my WordPress website. Directly? No, you can’t run .Net in a browser, and the closest available is silverlight and activeX, both of which were discontinued. As I understand it, the problem is that VB.net doesn’t run on an Apache … Read more

Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)

You’re looking at the problem the wrong way. The error you’re seeing isn’t an error coming from WordPress, it’s a PHP error. Somehow, somewhere, something is limiting the memory limit to 96M, and it ain’t WordPress that’s doing it. Here’s the thing: WordPress can’t actually limit the memory on most servers. I know that it … Read more

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