apache - Apache2 - Mod_rewrite and .htaccess -
i using ubuntu 14.04 , apache 2.
here phpinfo file: https://www.vivashost.com/phpinfo.php
here .htacess file:
options +followsymlinks rewriteengine on rewriterule ^feature-pricing-tables.html$ feature.html
here /etc/apache2/sistes-available/000-default.conf file:
<virtualhost *:80> # servername directive sets request scheme, hostname , port # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www/html <directory /> options followsymlinks allowoverride </directory> <directory /var/www/html> options indexes followsymlinks multiviews allowoverride order allow,deny allow </directory> servername vivashost.com redirect "/" https://www.vivashost.com/ # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. example # following line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
but when try open https://www.vivashost.com/feature.html giving me 404 error.
i trying make rewrite rule when open feature.html apache2 must load content feature-pricing-tables.html file.
where mistake, can please me out fix thing ?
thanks in advance!
this common mistake made: you've declared rule backwards.
currently, rule says if access feature-pricing-tables.html
, load content of feature.html
.
use instead:
rewriterule ^feature.html$ feature-pricing-tables.html [l]
also, l
flag necessary here - in case add other rules, want stop processing if there's match rule.
Comments
Post a Comment