Stupid htaccess Tricks – Perishable Press
Literally everything I ever wanted to know about HTAccess:
Literally everything I ever wanted to know about HTAccess:
Stupid htaccess Tricks – Perishable Press
Graphic designer since before the Internet. Started with newspaper paste-up; then art director for advertising agency in Reno, NV; and now freelancer designing marketing materials, print-on-demand t-shirt art, websites, and social media graphics.
WordPress security plugin from Perishable Press: a simple script that protects your website against malicious URL requests. Block Bad Queries (BBQ) checks all incoming traffic and quietly blocks bad requests containing nasty stuff. Share this post: Share on X (Twitter) Share on Facebook Share on LinkedIn Share on Email
Problem: Changing “name and date-based” permalinks to “name-based” permalinks breaks all of my site’s old links. Changing: https://www.designparc.com/2008/08/08/post-title/ To: https://www.designparc.com/post-title/ breaks the former date-based connection. Solution: Rick Beckman’s “How to Update Your WordPress Permalinks Without Causing Link Rot” article Add RedirectMatch call to .htaccess file so that old “name and date-based” permalinks will seamlessly redirect to “name-based” permalinks….
How to force HTTPS using the .htaccess file – InMotion Hosting To force all web traffic to use HTTPS insert the following lines of code in the .htaccess file: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] Note: Be sure to replace www.example.com with your actual domain name. Setting up Permanent 301 Redirects –…
A fix for Facebook shop images not showing Problem: Main product images not showing in Facebook Shop. Thumbnails show up fine in the catalog, but as soon as I click on a product thumbnail, the popup is blank. There’s NO main product image! I’m using Facebook for WooCommerce to get my Printful products from my…
Resources to stop Hotlinking via HTAccess Preventing hot linking of images and other file types – JavaScriptKit RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?mydomain.com/.*$ [NC] RewriteRule .(gif|jpg|js|css)$ – [F] Prevent hotlinking with a .htaccess file – MediaTemple RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)example.com/.*$ [NC] RewriteRule .(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ – [F] Smarter Way To Prevent…
Better Robots.txt Rules for WordPress – Perishable Press WordPress robots.txt Example – Yoast Robotstxt.org Disallow Robots Using Robots.txt – David Walsh Block or remove pages using a robots.txt file – Google In particular, I use the following to prevent the crawling of “test” sites: Preventing your site from being indexed, the right way! – Yoast…