By broodforge
Greetings to all,
First I would like to thank DigitalOcean for their excellent tutorials and How-To’s and to all kind members supplying really excellent stuff. Information found here is a true gem!
Now I have a problem with webserver nginx and I don’t know how to solve if directories does not contain index.php. I get 403 error!
For example lets say I have folder structure as follows:
/contact/ (folder)
/about/ (folder)
Do I have to rename the files to index.php or can it be solved in any other way?
Cheers to all in the ocean!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
By default, if you go to a directory’s url, only the index file be shown. This is configured by this setting in your Nginx configuration,
index index.php index.html index.htm;
That said, your solution is generally how it is handled for a non-standard directory:
location = /contact/ {
rewrite ^(.*)$ /contact/contact.php;
}
Thanks for following up and sharing your solution!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.