Sorry for this one... Html home page?

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 4:09 am

Can I have an html website and a joomla website connected?

When someone comes in to the website they land on the home.htm. My home.htm would have links to the Joomla pages. Can an html site and a Joomla site coexist?

I'm certain there are "better ways", but eat is the easiest short term path for my skill set.

I Googled and was flooded with the wrong results.

Thank you for your input!

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 7255
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Sorry for this one... Html home page?

Post by AMurray » Sat Sep 04, 2021 5:35 am

Yes you can. Usually you create a "home" page that is a Joomla article, and when you link it to a menu item, you specify it as the "home" page using the gold star under the Menu item manager to indicate it as "home".

You could do the same thing but just make an "external url" item and make that your "home" item with the gold star.

Basically the method to do this (and maybe you would searching for the wrong thing in Google)....:

To get the site to load the correct 'index' page if you only type in the URL www.yoursite.com (not www.yoursite.com/index.html), the server can be set so it looks for the relevant "index" pages in order and loads the first one it finds.

Write this line in your .htaccess file, exactly as written:

Code: Select all

DirectoryIndex home.htm index.php
(adjust the filename(s) to suit those that are used by your host -- they are not all applicable - you might need to rename "home.htm" as "index.html")

This means the server will look for 'index.html' first ahead of index.php.

I'm not saying this will be guaranteed to work - I'm not aware of any 'conflicts' between having the two index files but the index.php one must be there since Joomla uses it.
Regards - A Murray

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 5:40 am

Wow, just skimmed that and it sounds like you hit all the bases. Let me dig back through it, but thank you for that answer. It feels very approachable. Lol. Let's see what questions pop up.... Great answer!! Just wanted to thank you before I get lost in your answer.

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 7:06 am

"make an "external url" item"

An item? Is that a Joomla specific term?

Ah, I see what you are doing with the htaccess code there. You are giving the order they should be sought out, and it should load the first it finds.... That's not right, then why include both? Basically I will have an .htm name for the html website... yes, I know... And as I recall the Joomla home is index.php. It's been a while.

If I'm thinking clearly, my index.html doesn't have to be named index.html, does it? So that may help alleviate any potential confusion.

I believe I could create a series of html pages "in front" of the Joomla site. html1, html2, html3, links to Joomla and back. The two would co-exist however needed. This would be useful. I'm not just limited to a single html page.

So, the gold star. I understand I designate the home page in my menu. I see it here. I can't unchoose it, I can only select another, so I presume there is no need to change that.

So, all my original links stay good, no messy redirects. I just need to work on the template and a couple other things. Very helpful! Please try to follow my response to see if I have missed anything. I don't know much, but I do know that it doesn't take much to create a GIANT mess.

Regards

User avatar
abernyte
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4066
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse - Scozia - Escocia - Škotija -स्कॉटलैंड

Re: Sorry for this one... Html home page?

Post by abernyte » Sat Sep 04, 2021 9:15 am

I believe I could create a series of html pages "in front" of the Joomla site. html1, html2, html3, links to Joomla and back. The two would co-exist however needed. This would be useful. I'm not just limited to a single html page.
Hmm, not too sure about this. If a visitor types a domain name into a search engine, www.yoursite.com, without specifying a page then the webserver will deliver the default page for the directory viz. index.html, if it is present, or index.php if it needs to use the php pre-processor. To find index2.html you would have to type that url - www.yoursite.com/index2.html

Not really sure how your multi page gateway is going to play out. Can you expand on why you are trying to bolt a html site onto Joomla?
"Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it." Thomas Paine

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 40482
Joined: Sat Apr 05, 2008 9:58 pm

Re: Sorry for this one... Html home page?

Post by Webdongle » Sat Sep 04, 2021 10:20 am

1. Create the page as an Article
2. Set the menu item for the Article as Home menu item (you can hide that menu item if you wish)
3. Make copy of your default Template
4. Edit the Template's index.php to remove the module Positions.

There may be a 3rd party extension that will redirect on first visit?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 10:25 am

My logic. If I can have a single html page in front of Joomla, there there is the html page (index.htm) and the Joomla home page of (index.php).

If someone comes to mysite.com/index.htm, I can link them to mysite.com/color.htm. So now I have two html pages and I haven't yet entered into Joomla. If I have a link on mysite.com/color.htm to go to index.php, then I am now on the Joomla pages. If I have a hyperlink on the Joomla home page back to mysite.com/color.htm, then the viewer can jump from one to another seamlessly. I hope. But at the very least I want to do a single html page as the new home page.

Why the madness? Schedule and skill sets. My Joomla website has a number of issues I am working on right now, but in the interim I want to have an html site and I was exploring htaccess 301 redirects, but that was complicated.

I was going to scrap my Joomla sight and start fresh, but I am discovering there is a lot of good content there I can use and it has a structure and incoming links and history with search engines. So, I'm just putting on a new front face using an html program with some simple animations to modernize the look. Short, sweet, and buys me time.

So, in it's simplest form I guess the question is can my root folder have both index.htm and index.php. With your htaccess suggestion, it would appear so.

I'm not sure if I understand your reservation, but does it relate to the need for Joomla to be entered into at index.php? In other words, if I am browsing on the html site click a link that would take me to the Joomla side, would Joomla engage?


OR....... scrap everything and approach differently. mysite.com is index.php, but my home page would immediately forward to my index.htm, and external hyperlink to a page named index.htm. And again, I don't think it needs to be named index.htm.

I just want someone to initially hit that html page first either through redirecting or forwarding.

If the index.php has to be hit first for Joomla to work then maybe immediately advance the user to mysite.htm.

Sorry, I didn't expect the quick response. I appreciate it.

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 10:32 am

Webdongle wrote:
Sat Sep 04, 2021 10:20 am
1. Create the page as an Article
2. Set the menu item for the Article as Home menu item (you can hide that menu item if you wish)
3. Make copy of your default Template
4. Edit the Template's index.php to remove the module Positions.

There may be a 3rd party extension that will redirect on first visit?
I'm trying to utilize a specific software that I have been using. I thought about my html site on a Joomla page and call that home. Is that what you are suggesting? I think I can see how that would work by hiding menus. So I would do this with a blank Article? I recall questions from people in the past that wanted to inked an external html page on in their Joomla site. Am I on the right track?

The Joomla site is the old version of the website. Until I figure out all the incoming links and redirects that I would need, this is a quick way for me to leave all SEO in tact and just add a pretty front while I work on the templates on Joomla and some other issues.

User avatar
Pavel-ww
Joomla! Guru
Joomla! Guru
Posts: 549
Joined: Tue Jun 30, 2020 12:17 pm

Re: Sorry for this one... Html home page?

Post by Pavel-ww » Sat Sep 04, 2021 11:25 am

LawsonP wrote:
Sat Sep 04, 2021 10:25 am
Why the madness? Schedule and skill sets. My Joomla website has a number of issues I am working on right now, but in the interim I want to have an html site and I was exploring htaccess 301 redirects, but that was complicated.
Hi. I think you just create a big headache with SEO and administering in the future. What you now seem to be a rapid solution, in fact a big crutch that will cause difficulties.

Just spend a little more time to find out how your HTML integrate in Joomla. For example, you can install a new, more flexible template than you have now and gradually transfer the site pages on it.
If you have difficulty encoding, take a look at the Helix Ultimate + SP Page Builder or analogues.

User avatar
Jaydot
Joomla! Explorer
Joomla! Explorer
Posts: 495
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: Sorry for this one... Html home page?

Post by Jaydot » Sat Sep 04, 2021 12:56 pm

LawsonP wrote:
Sat Sep 04, 2021 4:09 am
...Can an html site and a Joomla site coexist?...
Yes, I do this often. When I'm developing a Joomla site, or implementing some major changes, I just pop an HTML page "in front of it".
When someone visits the site, the server will render either index.html or index.php, as set by the server as default (usually index.php), or set by you in .htaccess, as explained by @AMurray.
When I want to have the Joomla site render first again, I just rename the index.html to tempindex.html or something.
To access your Joomla site while it's "behind" the HTML page, you have to add .../index.php to the URL.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 2:04 pm

Pavel-ww wrote:
Sat Sep 04, 2021 11:25 am
LawsonP wrote:
Sat Sep 04, 2021 10:25 am
Why the madness? Schedule and skill sets. My Joomla website has a number of issues I am working on right now, but in the interim I want to have an html site and I was exploring htaccess 301 redirects, but that was complicated.
Hi. I think you just create a big headache with SEO and administering in the future. What you now seem to be a rapid solution, in fact a big crutch that will cause difficulties.

Just spend a little more time to find out how your HTML integrate in Joomla. For example, you can install a new, more flexible template than you have now and gradually transfer the site pages on it.
If you have difficulty encoding, take a look at the Helix Ultimate + SP Page Builder or analogues.
I'm not following what you think would cause a big SEO problem. How so? The only thing I would be changing would be the addition of the index.htm file. The rest of the website would remain in the same location as it was.

I don't even know what the words Helix Ultimate +SP Page Builder or analogues are? And that scares me. Its simpler for me to keep what I have and add a front. I just want to know if it's possible and how that would be setup. It sounds like the htaccess file is key to the solution, and I can be rolling later today. I've got far to much on my plate to start learning something new in this situation.

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 2:17 pm

Jaydot wrote:
Sat Sep 04, 2021 12:56 pm
LawsonP wrote:
Sat Sep 04, 2021 4:09 am
...Can an html site and a Joomla site coexist?...
Yes, I do this often. When I'm developing a Joomla site, or implementing some major changes, I just pop an HTML page "in front of it".
When someone visits the site, the server will render either index.html or index.php, as set by the server as default (usually index.php), or set by you in .htaccess, as explained by @AMurray.
When I want to have the Joomla site render first again, I just rename the index.html to tempindex.html or something.
To access your Joomla site while it's "behind" the HTML page, you have to add .../index.php to the URL.
Great, that makes some sense. Ok, I have a very long htaccess file already in my home folder geared towards Joomla. I see an option to attach a document below, so I'll do that. I believe the script was designed to limit various access points on the Joomla website. In particular there is the following Mod_rewrite in use. I'm not sure what function that serves.

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

I attached the complete htaccess code.

But, I just add the code from @AMurray to my existing htaccess file. I don't know if there is a preferred location of the script? I know order can be important at different times.

Thanks for your help. I feel like I am VERY close to a solution, which has been a long time coming. It has been very frustrating, and I was just going to start from scratch, but the more I looked at my old website the more good links I realized already existed. So, here we are. Everyone's help is greatly appreciated.
You do not have the required permissions to view the files attached to this post.

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Sat Sep 04, 2021 2:24 pm

AMurray wrote:
Sat Sep 04, 2021 5:35 am

Write this line in your .htaccess file, exactly as written:

Code: Select all

DirectoryIndex home.htm index.php
(adjust the filename(s) to suit those that are used by your host -- they are not all applicable - you might need to rename "home.htm" as "index.html")

This means the server will look for 'index.html' first ahead of index.php.
DirectoryIndex home.htm index.php

Would this code cause a problem if the home.htm was not there yet. If it goes as planned I should be able to paste this into my htacess file and as long as there is not home.htm file, it will go to index.php instead. Makes sense, I just want to repeat it before I commit to a direction.

Thanks!!

I JUST SAW A CONFLICT... There is already an "index" command in the code. Read the last line below. I presume I would just comment it out and replace it with the new code "DirectoryIndex home.htm index.php"

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that disallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## No directory listings
IndexIgnore *

User avatar
abernyte
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4066
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse - Scozia - Escocia - Škotija -स्कॉटलैंड

Re: Sorry for this one... Html home page?

Post by abernyte » Sat Sep 04, 2021 5:12 pm

Mod rewrite is what gives you SEF urls. Leave it on. Why does your site not have a secure certificate? Don't alter the .htaccess until you have the new index.html in place or there wont be an index page to find.
IndexIgnore is there to prevent the webserver listing all the files in the root directory in the event that there isn't an index.html or index.php page available. That would be a security risk.
I note that Jaydot uses the index.html as an "under construction" page and not as the finished solution which is the normal use for such a file in front of a Joomla site.
I agree with Pavel that this looks like a poor design decision but it is your site and you know your requirements and time constraints. Is the Joomla site a very out of date version?
"Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it." Thomas Paine

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Wed Sep 08, 2021 10:32 pm

The version is current. The templates were problematic. Plus there is a content and structure in place. Perhaps I can revisit a better solution in the future, but for now this has to be my solution.

If I put the .htaccess info in there, I was under the impression that it was presenting an order for the visitor to the home page. If there is no .htm, then it would jump to the .php, which would be fine.

All right, I'll forge ahead and see what awaits. Thanks again for your help. Had to move my computer this weekend so I just got it all set back up. Sorry for the delay.

LawsonP
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Wed Oct 21, 2009 8:29 pm

Re: Sorry for this one... Html home page?

Post by LawsonP » Fri Oct 22, 2021 3:14 pm

DirectoryIndex home.htm index.php

This worked perfectly! So if there is an home.htm in the root folder then it opens. If not, the website opens index.php.

I have one other resulting issue that I want to chase down specifically. The Joomla website has it's own .htaccess file, and the new website wants it's own .htaccess file as well. I read that one can have just a single .htaccess file that applies to two different websites. Here is the example that was offered, and the link.

https://stackoverflow.com/questions/521 ... pplication
RewriteCond %{HTTP_HOST} ^www\.site1\.example [NC]
RewriteRule ^(.*)$ index.php?domainname=site1 [NC,QSA]
RewriteCond %{HTTP_HOST} ^www\.site2\.example [NC]
RewriteRule ^(.*)$ index.php?domainname=site2 [NC,QSA]

So I have two .htaccess files I need to merge, or make sure they don't conflict. Can I apply the above technique to solve my problem? I'm SO close if I can make this work.

I have my Joomla site .htaccess code as follows:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]

RewriteBase //
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

And believe I need to combine it with this .htaccess file as a single folder can't have two .htaccess files.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?mywebsite\.com$ [NC]
RewriteRule ^(.*)$ https://mywebsite.com/$1 [L,R=301]
</IfModule>


Is this possible? Can someone please help. Can I delineate what code applies to which website? Let's call them mywebsite1.com for the Joomla site and mywebsite2.com for the second website.

To simplify the questions, let's just say that I am putting an under construction html page on mywebsite2.com. I am using the Joomla index.php, and the html site of home.htm. (DirectoryIndex home.htm index.php) That's where this code comes into play, which works perfectly. I just need to merge the .htaccess files.


Post Reply

Return to “General Questions/New to Joomla! 3.x”