htaccess not working

htaccess redirects not working, works on my local xampp installation. tried installing apache mods, but nothing seemed to help. what would be the easiest way to solve this?

also want everything else to work, deflation thingies etc.

my htaccess:

666

ErrorDocument 404 /

ErrorDocument 403 /

ErrorDocument 500 /

AddDefaultCharset utf-8

Options -Indexes

Options All -Indexes

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule !.*.php$ %{REQUEST_FILENAME}.php [QSA,L]

AddType application/x-httpd-php .form

AddType application/x-httpd-php .loader

ExpiresActive On

ExpiresByType text/php "access 1 month"

ExpiresByType text/html "access 1 month"

ExpiresByType image/jpg "access 1 year"

ExpiresByType image/png "access 1 year"

ExpiresByType text/css "access 1 month"

ExpiresByType text/loader "access 1 month"

ExpiresByType text/x-javascript "access plus 1 month"

ExpiresByType application/javascript "access plus 1 month"

ExpiresByType application/x-javascript "access plus 1 month"

ExpiresByType image/x-icon "access 1 year"

ExpiresDefault "access 1 month"

AddOutputFilterByType DEFLATE text/plain

AddOutputFilterByType DEFLATE text/html

AddOutputFilterByType DEFLATE text/xml

AddOutputFilterByType DEFLATE text/css

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/rss+xml

AddOutputFilterByType DEFLATE application/javascript

AddOutputFilterByType DEFLATE application/x-javascript

AddOutputFilterByType DEFLATE application/x-httpd-php

AddOutputFilterByType DEFLATE application/x-httpd-fastphp

AddOutputFilterByType DEFLATE image/svg+xml

order allow,deny

deny from all

4 Replies

So i installed debian 8 and apache .. and I get my files working properly, apache core installed, files show up, php works, but htaccess redirects dont :evil: :shock:

Aah okay, had to put AllowOverride All in all 3 places in apache2.conf

Oh and.. had to fix this part as well:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule !.*.php$ %{REQUEST_FILENAME}.php [QSA,L]

Note: Restarting httpd is not essential for .htaccess files. .htaccess files are specifically for those who don't have root access to the httpd server config file, and are unable to restart the server.

If .htaccess files are being ignored, you need to ensure that AllowOverride is set properly. See http://httpd.apache.org/docs/2.4/mod/co … owoverride">http://httpd.apache.org/docs/2.4/mod/core.html#allowoverride for details. You need to also ensure that it is set in the right block in your configuration.

If you want to check that a .htaccess file is in fact being read, put garbage in it. An invalid line, such as "INVALID LINE HERE", in your .htaccess file, will result in a 500 Server Error when you point your browser at the directory containing that file. If it doesn't, then you don't have AllowOverride configured correctly.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct