Hotlinked images issue

Hi!

I just created a website to work on it on local.

All seems to work normally except the images from my sliders (I use the Slider Revolution plugin)

I have a hot linked error message.

Usually, I put that protective code in all my .htaccess files:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?domain.example [NC]
RewriteRule .(jpg|jpeg|png|gif)$ http://fakeimg.pl/800x600/?text=Pas_touche_aux_images [NC,R,L]

But there is nothing like that in the local .htaccess file… (even in the live site from which I downloaded the wp-content backup to create this local site)

Maybe it comes from the database backup?

Also, if I add domaine-example.local instead of domain.example, there is no change on front.

Do someone already have this issue?

PS: sorry for my english, I’m french ^^

PS2: In the Revolution Slider tables from the database, I can see it has kept the original urls (example.domain) so that’s probably the reason of the issue.
If I manually change them with example-domain.local, when I’ll push the local site on live, I guess I’ll have a problem.

Do you know how I can skirt this?

Hi @Arcantide

As far as htaccess, if you created a site with Apache instead of NGINX you should be able to find and change this file. More details here: Where to find the htaccess

For your images and URLs you might have to run some search and replace commands manually, or find a plugin that can help you with this. If you open your Site Shell you could try something like the following:

  • Run the following WP-CLI command
    wp search-replace 'SITEURL' 'LOCALURL' --skip-columns=guid

  • Replace SITEURL with your production URL like https://localwp.com

  • Replace LOCALURL is your Local Site URL like http://mysite.local

  • Trust Local’s SSL certificate

  • Disable certain types of plugins: caching, security, force HTTPS/SSL

If you move your site to a host to make it live, they should be able to run some automatic search and replaces for you but you should also be able to touch these up manually or with a plugin if anything else needed stitched up.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.