N
N
Nicksemkin2016-09-27 18:56:18
PHP
Nicksemkin, 2016-09-27 18:56:18

I uploaded the .htaccess code, and because of it, pages are downloaded. What's the matter?

Pages of the form page.html, over time it was necessary to use php-code on these pages. Changing the extension from page.html to page.php is not an option. In the search engine in high positions of the page.
As a result, I found a code that allows you to process php on html pages.
Together with all the code, it turned out like this:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]

AddType application/x-httpd-php .php .htm .html



RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html


RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ http://vash-master.tv/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html

RewriteCond %{REQUEST_URI} /index
RewriteRule ^(.*)$ http://vash-master.tv/ [R=301,L]

But the problem is that after adding this line, you open any page and just starts downloading it, instead of opening it. What's the problem? I don't understand.
Hosting hc.ru, if it matters. Maybe something in the code conflicts? Tell me please.
PS Without this line, everything else works fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-09-28
@shambler81

RemoveHandler .html .htm 
AddType application/x-httpd-php .php .htm .html .phtml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question