I
I
Ivan2020-07-25 15:41:34
htaccess
Ivan, 2020-07-25 15:41:34

How to open a page at a different address?

You need to make the htacess tools so that the page located at the address /main.html opens as a directory /main/.
Do: Doesn't work.
RewriteRule ^main$ main.html [L]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2020-07-25
@skapunker

RewriteRule ^main$ main.html [L]
Here the template will match only with the request /main
A for you /main/need a template^main/$
RewriteRule ^main/$ main.html [L]

M
Megum1n, 2020-07-25
@Megum1n

RewriteEngine On
RewriteBase /
RewriteRule ^main$ main.html [NC]
RewriteCond %{THE_REQUEST} ^.*/main\.html
RewriteRule ^main.html$ /main/ [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question