0

I use magento and It worked fine.Then I migrated my website to another hosting and when I go to Url www.mywebsite.com/skin or some folder and it show my website folder to everyone

It should be Show 404 error page in my custom theme

Please help me how to redirect www.mywebsite.com/skin to my 404 error page theme

Sorry for my bad english and I'm very new to website coding.

Maz I
  • 3,664
  • 2
  • 23
  • 38
sobaaroi
  • 89
  • 1
  • 1
  • 5
  • does this hosting allows you to change the root `.htaccess` file? – Tomás Dec 08 '13 at 10:10
  • Possible related http://stackoverflow.com/questions/5932641/deny-directory-listing-with-htaccess?lq=1 – Tomás Dec 08 '13 at 10:13
  • if your .htaccess is not allowed you can just add a index.html or index.htm file on each folder.Make the page look like your 404 page. – bansi Dec 08 '13 at 10:20
  • Thanks everyone. Yes i can edit my .htaccess file – sobaaroi Dec 08 '13 at 10:39
  • Sounds like your transfer method did not move your .htaccess files from your old installation. It's common where people think FTP is a usable method to move everything from the test site to the new site. It often isn't because *nix hidden files (files starting with .) are hidden to the FTP client unless you change a configuration setting. .htaccess files are scattered all through Magento's directories to prevent this kind of access. – Fiasco Labs Dec 08 '13 at 20:09

2 Answers2

5

Add this code in .htaccess. It blocks the folders to be seen if no index file inside it.

Options All -Indexes
CoursesWeb
  • 4,179
  • 3
  • 21
  • 27
  • your method works! and another folder already show Forbidden page but but when I go to www.mywebsite.com/js it shows SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js – sobaaroi Dec 08 '13 at 10:37
  • Go expand out Magento's install package somewhere on your local disk, find all the .htaccess files and make sure they're copied to the proper locations on your live Magento install. – Fiasco Labs Dec 08 '13 at 20:10
0

put a .htaccess file in any folder you want to restrict it to the user and paste below code at the top.

deny from all
Moeed Farooqui
  • 3,604
  • 1
  • 18
  • 23