A
A
Alexander Grimashevich2019-03-22 17:06:50
HTML
Alexander Grimashevich, 2019-03-22 17:06:50

Wordpress + HTML files: how to make a redirect?

Good day.
There is a site on Wordpress. Wordpress is installed in the root directory. And there are HTML files that lie in the /html/ folder. You need to make sure that template dynamic WP and HTML pages from the /html/ folder are also available (but no html in the url).
Can you please tell me the best way to implement this?
I thought about a redirect in .htaccess, but I don’t know something yet, maybe there are other options.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-03-22
@jams

The rule for the /html/ folder should be placed above the WordPress CNC rules.

RewriteCond %{DOCUMENT_ROOT}/html/$1.html -f
RewriteRule ^([^/]+)$ /html/$1.html [L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question