Home >
Technical & Creative Skills >
Programming, Servers & Scripts
Combining WordPress based Website & Static HTML landing page (6)
01-13-2021 04:35 AM
#1
gobroke (Member)
Combining WordPress based Website & Static HTML landing page
I like to create a WordPress based website that contains articles and videos. Because WordPress can slow down the loading process, I need to use static landers to promote offers and do lead-gen on a mobile device. Am I going to encounter some technical problems in the future if I combine WordPress and static HTML? Should I place this static lander inside the public folder?
01-13-2021 06:26 AM
#2
plutus (Member)
There won't be any problems if your main .htaccess file is unmodified.
You can create directory with index.html in public folder and it will work out of the box.
Let me get a bit technical and explain why actually this will work.
Go to the WP support, to the article about htaccess: https://wordpress.org/support/article/htaccess/
As you can see, there are those two lines there:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
followed by
Code:
RewriteRule . /index.php [L]
Those first two lines are somewhat like if statement
first line can be interpreted as "if requested filename is NOT a file"
and second one as "if requested filename is NOT a directory"
followed by the rewrite rule itself that says to point the webserver into index.php
This bascially means that "IF requested file is NOT a directory OR a file, point webserver to index.php (wordpress stuff) ELSE display file / directory"
This is used by wp to serve css, js, images and can be used by you to serve static htmls.
01-13-2021 07:49 AM
#3
jeremie (Moderator)

Originally Posted by
gobroke
Am I going to encounter some technical problems in the future if I combine WordPress and static HTML?
Can you define what you mean by combine?
There is a WP to static plug in converter that could be interesting to have a look at:
https://wp2static.com/
01-13-2021 09:20 AM
#4
matuloo (Legendary Moderator)

Originally Posted by
jeremie
Can you define what you mean by combine?
There is a WP to static plug in converter that could be interesting to have a look at:
https://wp2static.com/
I believe the OP wants to use static (custom coded, so not part of WP) pages on the same domain where he hosts his WP install. And he's worried about possible conflicts with the WP page itself.
So as plutus already explained above, as long as the "static" stuff is hosted in it's separate directory, it shouldn't cause any problems, I believe.
01-13-2021 10:47 PM
#5
gobroke (Member)

Originally Posted by
plutus
There won't be any problems if your main .htaccess file is unmodified.
You can create directory with index.html in public folder and it will work out of the box.
Let me get a bit technical and explain why actually this will work.
Go to the WP support, to the article about htaccess:
https://wordpress.org/support/article/htaccess/
As you can see, there are those two lines there:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
followed by
Code:
RewriteRule . /index.php [L]
Those first two lines are somewhat like if statement
first line can be interpreted as "if requested filename is NOT a file"
and second one as "if requested filename is NOT a directory"
followed by the rewrite rule itself that says to point the webserver into index.php
This bascially means that "IF requested file is NOT a directory OR a file, point webserver to index.php (wordpress stuff) ELSE display file / directory"
This is used by wp to serve css, js, images and can be used by you to serve static htmls.
Thank you. So as long as I don't modify htaaccess and I keep the static html inside a different folder from wordpress, there should not be a problem.
01-14-2021 05:05 AM
#6
plutus (Member)

Originally Posted by
gobroke
Thank you. So as long as I don't modify htaaccess and I keep the static html inside a different folder from wordpress, there should not be a problem.
Correct. The directory structure you use will be the one that you need to use to access the static pages.
To put simply, directory structure (placed in root of public folder) of /a/b/c/index.html, where a, b, c are directories, and index.html is a lander file...
...and where c is inside b, b is inside a, a is inside public folder would be accessed on the browser by navigating to yourwebsite.com/a/b/c/index.html
So, as you can see you can have multiple landing page variations stored like that.
One important thing to mention are WordPress permalinks - be careful to NOT name your static directory like one of your wordpress pages / posts as it would display the static file instead of the WP content.
Home >
Technical & Creative Skills >
Programming, Servers & Scripts