I’ve 2 almost identical posts:
- https://webscraping.pro/reliable-open-proxies-for-business-directories-scrape/
- https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/
I want to delete first one to remove excess…
Since I might have left permalinks to it (first one) at other blogs or social services, so I want to keep its slug that is /reliable-open-proxies-for-business-directories-scrape/ and make that slug to refer to the second post. This way visitors gets redirected to the second post when hitting the slug of a deleted post.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You can use a plugin or edit the .htaccess file yourself (located in the root WordPress directory).
Use FTP or your host and edit your .htacess file.
Keep in mind, this code will only work if your server is run with Apache.
Enter the following code (if you know for sure your server already has the mod_rewrite module):
RewriteEngine On Redirect 301 /reliable-open-proxies-for-business-directories-scrape/ https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/
The RewriteEngine is part of the mod_rewrite module in Apache. Keep in mind, the mod_rewrite module is loaded by default in Apache, BUT, if it’s not loaded you will have to force the load by wrapping it with the following code.
<IfModule mod_rewrite.c>
RewriteEngine On
Redirect 301 /reliable-open-proxies-for-business-directories-scrape/ https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/
</IfModule>
The wrapping of the IfModule seems to be a standard for rewriting non-existing links to another file. – since if the server administrator removed the mod_rewrite module from the server, then the code can break the system. Your telling apache “if mod_rewrite does exist – run this code”.
Once that is setup, delete the /reliable-open-proxies-for-business-directories-scrape/ post.
You are good to go.
Of course, with editing any core files, make sure to create a backup before making edits.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0