In your previous ticket you were insisting that the problem was linked to Joomla 6.1 which I categorically told you was not the case. No, we are not talking about the same thing here at all.
Second, in this ticket you are telling me that adding a leading forward slash to "Base directory of your site (/ for domain's root)" makes a difference. No, it does not.
With all the information you gave me in this new ticket I finally understand what you're doing wrong and why you're getting so confused about what the problem is. Next time lead with what you're doing, not what you think is wrong. If you've ever watched the "Dr. House, MD" show that's what the titular character was referring to when he was quipping "patients lie". By definition, if you're here talking to me – or, generally, to any other expert be it a software developer, your car mechanic, or a doctor – your idea about what is wrong is in itself wrong. If you could accurately understand what's wrong you'd have fixed it yourself. Give me the neutral facts (what you did, what you saw) and I can help you. If you keep focusing on your misinterpretation I will not be able to help you.
In this ticket you are giving me your misinterpretation but, crucially, also enough of the objective facts to allow me to understand what is actually going on. And it's so simple you'll probably be screaming in frustration: you just need to regenerate the .htaccess file after restoring your site in a new location since the restoration script cannot do that for you, it only changes the .htaccess Maker's configuration.
TL;DR. You need to do two things:
- During restoration, in the Site Setup page, set ".htaccess Handling" to "Use default"
- After restoration, log into your site's backend, Components, Admin Tools, .htaccess Maker, click on Save & Create .htaccess in the toolbar.
Here's why.
When you extract a backup archive its .htaccess file is extracted renamed to htaccess.bak so that it does not break the restoration. Upon clicking on the Clean-up button this file – the original file extracted from your backup – is renamed back to .htaccess. Since your backup comes from a site installed a different directory (note that the root of a domain is, indeed, a different directory to any named subdirectory) the old .htaccess doesn't work and throws an HTTP 404 Not Found. Hence step 1: you tell the restoration script to replace that .htaccess with the neutral Joomla default which at the very least allows you to visit your site's backend.
As I told you before, the restoration script only updates the .htaccess Maker configuration in the database. It does not generate a new .htaccess file. Hence step 2: you tell the .htaccess Maker to create the .htaccess file afresh, adding the all-important RewriteBase line.
Now, let's move on to your observations. They are all wrong, but I do get why you think your irrelevant changes are important. Let me take this step by step and tell you what's really going on.
The leading slash in the rewritebase option ("Base directory of your site (/ for domain's root)") of the .htaccess Maker is completely irrelevant because any number of leading and trailing slashes are stripped in administrator/components/com_admintools/src/Model/HtaccessmakerModel.php line 410:
$rewritebase = trim($rewritebase, '/');
Regarding your expectation to see a RewriteBase / in the generated file, I am afraid it is completely wrong. The entire point of having the "Base directory of your site (/ for domain's root)" option is to catch the use case where your site is NOT in the site's root, therefore in need of a RewriteBase line. Hence the RewriteBase feature which is implemented in in administrator/components/com_admintools/src/Model/HtaccessmakerModel.php lines 407 to 413. In your case, if you are restoring into a directory called BFB613 then the X should be BFB613 (with or without leading/trailing slashes, they don't matter) and the generated RewriteBase line should read
RewriteBase /BFB613
Now, you said that your site worked after prefixing the "Base directory of your site (/ for domain's root)" option with a leading forward slash. I am afraid that this change made no difference whatsoever. What made all the difference in the world is that you clicked on the Save & Create .htaccess, i.e. you did the all-important step 2 noted above, regenerating the .htaccess file with the correct RewriteBase /BFB613 line.
I hope this helps. If something's unclear, do not hesitate to ask me. I really want to help people. That's the whole point of me being a FOSS developer.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!