Hello there! I just set up a droplet and so far i’m loving it. But i have two problems thats preventing me to launching my new site. I have a little knowledge of servers and vps servers but i’m not a pro at all haha. The first problem i’m having is that people are able to view my private files. For example they can type this in the url field:104.236.250.72/public/ and they can see everything in there. I cant figure out the mod_rewrite statement to make sure that when people try to access those urls that they are redirected or something
The second problem i have is with my .htaccess. My site is a custom made MVC website and it relies on .htaccess. All of the other pages work except the “index” page. When i type 104.236.250.72/index it gives me a 404 error that it cant find that file. But if i type 104.236.250.72/login it gives me the correct page.
This is how my .htaccess file looks:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?u=$1 [L]
</IfModule>
I also used this command in my ssh terminal:
sudo a2enmod rewrite
If someone can help me with these two problems, that would be great :)
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!
This comment has been deleted
Hi there,
In case anyone comes across this in the future, here are the things that I would usually check:
mod_rewrite module enabled Apache using the apachectl -M and looking for “rewrite_module” in the list of loaded modules.sudo systemctl restart apache2.htaccess file in the Joomla directory is correct: https://docs.joomla.org/Preconfigured_htaccessAllowOverride directive in the Apache configuration is set to “All” for the Joomla root directory. This will allow the .htaccess file to be used:
<Directory "/home/user/public_html">
AllowOverride All
</Directory>
tail -100 /var/log/apache2/error.logBest,
Bobby
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.