Laravel 5.8 - Uploaded images not showing on shared hosting - laravel

I've uploaded my Laravel site to shared hosting (I know....), the site has a image upload section which worked previously in my local set up.
The files do upload as expected but will not show in the view, I've looked everywhere for a solution so sorry if and answer is somewhere here already.
For example , this page http://www.navigatetheplanet.co.uk/blogs/England - the image at the top of the page was previously uploaded in local and is working as expected, but right at the bottom of the page there's a post with a image attached but return 404 ... from my investigations online it looks like it's something to do with the Symlink?

if you don't have ssh access then simply create a route.so you can hit this command simply by hitting url
Route::get('/storage/link', function() {
$command = 'storage:link';
$result = Artisan::call($command);
return Artisan::output();
})

Related

laravel file manager not showing uploaded image

I am new to laravel file manager and I'm developing a blog using tinymce5 and this package.
Everything works just fine. But...
The problem:
The problem is that none of the uploaded images are being shown. neither in file manager "when it's uploaded" nor in the blog.
image is not shown in file manager :
What I have done:
Well the problem is caused by the image url. The url is the url below:
http://localhost/storage/photos/maxresdefault.jpg
When I changed it to:
http://127.0.0.1:8000/storage/photos/maxresdefault.jpg
everything worked fine.
The Question is:
Is there any way to force laravel file manager to save image urls using "127.0.0.1:8000" instead of "localhost"?
Or is there any way to load images using a more efficient method?

My site got hacked and got many mirror sites which are copying original website

My site got hacked and cloned multiple times. Now if i post anything its get updated on all cloned sites. Can i use some code in such a way that if a user visits a cloned site, he is redirected to original one. Any modification in theme or htaccess file which could do the job. Any help would be
appreciated.
I am using WordPress on shared hosting. My site is dlsoftfree.com and mirror sites are
zoodsabt.com
Thanks
How do you know it was a hacker and not a web crawling ?
Try a Javascript code in the middle of your article.
<script>
//replace 'example.com' for your domain
if(! /^http[s]?:\/\/example.com\//.test(window.location.href)){
var url = window.location.href.replace(/^http[s]?:\/\/([^:\/\s]+)(\w+)+\//, "http://example.com/");
window.location.replace(url);
}
</script>
there is most probable a shell on the server a php file which they can go to via the browser which will give them access to any file on your server change your ftp info, your hosting login info, check all your files for different files which are not ment to be there.Your site is also linked to another when you click the posts it forwards you to another website.

GET image 404 (Not Found)

For my web app ,Some of the images keep giving me 404, which cannot be found. But I can see them on my local server, and they are uploaded to github when I push the code.
for example, none of the images can be found in this page. http://kyloxue.design/#/Project6?_k=gxpciy
I made sure that the first image is available with the correct url: https://github.com/alfance/alfance.github.io/blob/master/media/img/dme/all1.png
but most of the images in this page work fine. http://kyloxue.design/#/Project1?_k=nbyvg2
Any ideas?
Your paths are case sensitive. For example, you have an image referencing:
http://kyloxue.design/media/img/DME/all1.png
Change that to http://kyloxue.design/media/img/dme/all1.png and it works.

Profile picture requires reload to change

I'm having problem with my PHP application. People can upload a profile photo to show on their profile page. The problem is that once the photo is uploaded you need to refresh the page in order for the photo to change.
I'm redirecting the user back (after the upload succeeded) to the previous page with Laravel's redirect function, like so:
return Redirect::to("/user/". $id . "/edit");
I assume the photo is saved in the cache and needs to be refreshed? But that would be weird because when I redirect it actually "refreshes" the page.
Any help would be appreciated.
Thanks
You can cache-bust the image by attaching a random variable to the image url:
Cache Busting Files

Magento not showing images even if they are in the server

I've installed a Magento theme I bought and since the very first moment it doesn't load images. The weird thing is this:
The site show this:
If I get the url of the first image (Right Click: "Get image url") shows this:
http://ecobiobella.com/media/resized/s/blog/5.jpg
I navigate to this url the images don't exist and I get a 404 error.
The weird thing is that that image is IN MY server and accessible from the server, like this:
As last thing in the root folder public_html I loaded the same image and that gets showed up:
http://ecobiobella.com/5.jpg
I'm not understanding what I'm doing wrong....
Check the media folder for a .htaccess file and remove it.

Resources