PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label http-status-code-410. Show all posts
Showing posts with label http-status-code-410. Show all posts

Wednesday, June 29, 2022

[FIXED] How do I 410 a pattern of toxic Prestashop URLS?

 June 29, 2022     .htaccess, http-status-code-410, prestashop, url-routing     No comments   

Issue

I've been trying to 410 a pattern of a few thousands toxics URLS that got indexed by Google for one of my clients. I want every urls of the website that contain ?% to send a 410 response code so they got de-indexed.

Example of an URL :

https://www.example.com/fr/promotions?%25252525253Bid_lang=6&p=6

I've tried to put this in the .htaccess, above the If module section, as I found on another thread here, but it didn't work, any ideas ?

RewriteRule ^[a-z]shop($|/) - [G]

Solution

I want every urls of the website that contain ?% to send a 410 response code

Using mod_rewrite at the top of the .htaccess file:

# Send 410 for any URL where the query string starts with "%"
RewriteCond %{QUERY_STRING} ^%
RewriteRule ^ - [G]


Answered By - MrWhite
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Saturday, February 5, 2022

[FIXED] NGINX return 410 for deleted CSS and JS files

 February 05, 2022     css, http-status-code-410, javascript, nginx, wordpress     No comments   

Issue

I have a problem with a plugin I've deleted, apparently the cache on the users browser still send request for some JS and CSS files that are gone, the problem is that this is causing a lot of 404 errors in the logs (in 1 day I generated 4GB of error logs only containing the 404 deleted CSS and JS files).

I was trying to create a setting on NGINX that will send a 410 response to everyone that was trying to access the missing JS and CSS files, the path of the files is the same:

/wp-content/cache/autoptimize/js/autoptimize_single_32ab5663ad75c559c9af68098a1b63e6.js

/wp-content/cache/autoptimize/css/autoptimize_32c1c99d8f7a5a9618074737134c8f9c.css

I tried various location settings I found online for both all files that contains autoptimize_*.css and js and the folder /autoptimize, but it didn't work, it was like this:

location ^~ /autoptimize { return 410; }

What I'm missing?


Solution

Try :

location ^~ /wp-content/cache/autoptimize/ { return 410; }


Answered By - Pedram Gholizadeh
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing