html - .htaccess file not working on linux server -
i know there more questions , answers none of them usefull me.
i configured website on apache linux server,that i'm managing cpannel.and edited .htaccess
file remove html extensions url. after uploaded file manager , nothing changes.what need make work ?
i've been searching configuration files set allowoverride all
didn't found anything.and don't have etc/apache2/
directory in file manager, there other files in etc/
directory.
edit: server info :
hosting package:startup2013
server name: wolf
cpanel version: 11.50.1 (build 3)
theme: paper_lantern
apache version: 2.4.16
php version: 5.6.12
mysql version: 5.6.23
architecture: x86_64
operating system: linux
shared ip address: 185.81.0.40
path sendmail: /usr/sbin/sendmail
path perl: /usr/bin/perl
perl version: 5.10.1
kernel version: 2.6.32-573.3.1.el6.x86_64
here .htaccess
code :
rewriteengine on rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.html [nc,l]
i assume you're not running ubuntu server, that's why don't have /etc/apache2
directory.
try this:
edit httpd.conf
file in /etc/httpd/conf/httpd.conf
, set allowoverride all
then: apachectl restart
if doesn't work please run: cat /etc/*-release
, show output, can know linux distribution running.
edit: .htaccess working fine, op wanted remove .html extensions
this .htaccess need in order remove .html extensions:
rewriteengine on rewritebase / #removes .html extension rewritecond %{the_request} ^[a-z]+\s.+\.html\shttp/.+ rewriterule ^(.+)\.html $1 [r=301,l] rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.html [nc,l]
Comments
Post a Comment