I have moved all the files to a server via FTP. The problem is that the website doesn't show pages but an index list. I have tried different things like adding "DirectoryIndex index.html index.php" in the .htaccess file and I have a index.php file in the www folder but these solutions don't seem to work for me. I'm currently using Windows 7, Apache and WAMP.
2 Answers
hope this help you :)
Apache needs to be configured to recognize index.php as an index file.
The simplest way to accomplish this..
Create a .htaccess file in your web root.
Add the line...
DirectoryIndex index.php
Here is a resource regarding the matter... http://www.twsc.biz/twsc_hosting_htaccess.php
Edit: I'm assuming apache is configured to allow .htaccess files. If it isn't, you'll have to modify the setting in apache's configuration file (httpd.conf)

- 302
- 1
- 7
-
could you change things in the server? or it s an online provider like 1and1 – Javier Jimenez Matilla Jun 21 '17 at 17:36
-
I have to make changes locally and then upload it with FTP. – Jun 21 '17 at 17:38
-
it's look like the config of the server ignore your .htaccess publish. Whats the error it show – Javier Jimenez Matilla Jun 21 '17 at 17:46
-
It doesn't show any error messages. Only a page where it says Index of/ and with a list of files. – Jun 21 '17 at 18:34
-rw-------
These files don't appear to have enough permissions. They should be public readable if they are to be served to all users. Otherwise, the server won't be able to respond with the appropriate DirectoryIndex
and if directory indexes are enabled then Apache will generate a directory listing.
They should probably be -rw-r--r--
or 0644
... read/write by owner and read for group and read for public.
The same for your directories... drwx------
should probably be drwxr-xr-x
or 0755
.
When this has been fixed, you should probably disable Apache directory indexes. For example, add the following to your .htaccess
file or server config:
Options -Indexes
Try this now (with insufficient file perms) and you'll probably get a 403.

- 43,179
- 8
- 60
- 84
-
-
The FTP client usually has the option to change perms. Which client are you using? Do you have any other access to the server? SSH perhaps? – MrWhite Jun 21 '17 at 18:10
-
I use Filezilla. I'm new to FTP and don't know SSH. I will have a look at Filezilla again in terms of permissions. – Jun 21 '17 at 18:23
-
In FileZilla you can right-click the file and select "File permissions..." from the context menu. Type the numeric value or check the boxes and click "OK". – MrWhite Jun 21 '17 at 19:10
-
"They should be public readable if they are to be served to all users" This is misleading. If user/group 1373 actually is the Apache user/group, it's perfectly fine. Only Apache needs to be able to read the files. – Capsule Jun 22 '17 at 01:42