The Definitive Guide to Setting Up WordPress in 2024: A Bristol Freelance Web Developer’s Essential Setup
In the ever-evolving landscape of website development, staying ahead of the curve...
Prevent files from being directly accessed unless the user is logged in by pasting the following code into your .htaccess file. This is useful if you have a secure area on your website and you want to prevent secure files being shared via direct link.
You can specify file types by separating with a pipe symbol. Edit as required.
Paste the following code after “# END WordPress”.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !.*wordpress_logged_in.*$ [NC]
RewriteCond %{REQUEST_URI} ^(.*?/?)wp-content/uploads/.*\.(?:pdf|txt|rtf|xlsx?|docx?|mp3|mp4|mov)$ [NC]
RewriteRule . http://%{HTTP_HOST}%1/wp-login.php?redirect_to=%{REQUEST_URI} [L,QSA]
</IfModule>
Share
In the ever-evolving landscape of website development, staying ahead of the curve...
In the digital realm, your website serves as the cornerstone of your...
In the ever-evolving world of e-commerce, having a robust and flexible platform...
In today's digital age, having a strong online presence is crucial for businesses. When it comes to building a website,...
Commonly asked eCommerce questions: A nice little bit of information about #PCIDSS for @WooCommerce - http://goo.gl/BSK6Ba Lee Harris - Twitter...
This is the best method I found for completely removing the comments from WordPress. This combination of functions will remove...