Question
htaccess redirect non-existent directories to index.php
Goal: have www.website.com/anything redirect to www.website.com
Issue: 404
I’ve meticulously followed: https://www.digitalocean.com/community/questions/htaccess-and-subdomain-issues
Confirmed:
Activate Mod_Rewrite ✓
Create new .htaccess file ✓
Allow use of .htaccess ✓
Restart Server every change ✓
My current .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /
Misc. Fun Facts:
- I have multiple domains on the same droplet: var/www/site1.com, var/www/site2.com, etc.
- One other domain is using an .htaccess file in its respective site.com/ folder (conflict?)
- I have tried keeping .htaccess file inside public_html and inside site.com level
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
The tutorial link above was supposed to be this DO article, instead