A
A
Alexander Nosol2014-12-19 10:41:43
Apache HTTP Server
Alexander Nosol, 2014-12-19 10:41:43

How to add .html to my htaccess?

There was a problem.
Faced with the need to write on my own in php and need CNC.
Because few pages - I decided to use the capabilities of .htaccess.
I configured it - now I have an address like domen.ru/moskva-vladivostok
And I would like an address like domen.ru/moskva-vladivostok.html
Below is my htaccess code. I googled, tried to add .html$ according to the hints of the almighty (approx. Google) - nothing happened ...

#Deny from all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/$ /$1 [L]

RewriteRule ^([^/\.]+)-([^/\.]+)$ /search.php?out=$1&to=$2 [L]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Sergeev, 2014-12-19
@Doppler_ua

Frameworks? CMS? What generates a URl ?

S
Sergey Toy, 2014-12-19
@Toy

RewriteRule ^([^/\.]+)-([^/\.]+)\.html$ /search.php?out=$1&to=$2 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question