S
S
Sergey Goryachev2016-11-28 02:06:08
HTML
Sergey Goryachev, 2016-11-28 02:06:08

How to strip HTML from a URL without specifying a domain?

There is this code in htaccess.

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^\.]+)\.p?html?$ http://<ДОМЕН.РУ>/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]

I have 3 domains, I do not want to prescribe the same code for each.
How to make one code work for all 3 domains?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily, 2017-01-18
@xnscripter

%{HTTP_HOST}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question