By SimonThomsen
Hello, I’ve tried to follow this guide to enable the .htaccess on my server (so my .htaccess is working), but without luck.
Does anyone know where the problem can be?
Here is my htaccess file, it works on my localhost etc.
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
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
It does not work for me even if set AllowOverride All. What else can be a problem?
To remove the .php using .htaccess file, your .htaccess doc should look like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
In case you want to remove a .html extension and not a .php replace the last line with this:
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Finally for beginners, you can create .htaccess files from htaccesseditor.com Using their web interface
Hope this helps ;)
Cheers
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.