New domain

Permalink
Hello,
I created a development subdomain.

I duplicated a site and its database to apply an upgrade.
Unable to connect development domain.
dev.mysite.com

I tried to add the address in App.php

<? php

return [
'canonical-url' => 'http://dev.monsite.com',
'canonical-ssl-url' => '',
];

It does not work.

I also tried to change the address in site.php

'canonical_url' => 'http://dev.monsite.com',

Without success.
Both at the same time, no better.

It makes me crazy !

What is the solution, it shouldn't be complicated !?

Thank you for your help.

Elstud
 
tallacman replied on at Permalink Reply
tallacman
your main domain is also unreachable. Are you sure you have that spelled correctly?
Elstud replied on at Permalink Reply
Elstud
Hello,
The address shown is an example.
I am indeed sure of my address when I fill in the correct one.
But for the method?
What do you do when you want to change the address of a site, in this case to a copy intended for development?
Thank you
mesuva replied on at Permalink Reply
mesuva
You don't actually have to have the domains filled in via the configuration, you can leave them blank. I personally never fill them in, and use commands in .htaccess files if I need to enforce a domain.

So when they are blank, you can actually move a concrete5 site around and it'll work for whatever domain the hosting is for.

When we move from development to product, we simply copy the files, copy the database, update the database details and it'll work. It's after this point we'll do things like adjust the .htaccess file to enforce https or something like www.

One little test I often do to check if a site is at least working is try to visit /robots.txt, since it's a text file and shouldn't be impacted by PHP related issues. I'd try to visit that (and maybe make a quick edit to it to ensure that you are in fact looking at the right hosting account)
Elstud replied on at Permalink Reply
Elstud
Ok, I understand, but what should I add in the. htacces?

Currently I have this:

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --


I just try this and It works, but maybe I left too many lines?

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
   RewriteCond %{HTTP_HOST} domaine\.com [NC]
   RewriteRule ^ http://www.mywebsite.fr/ [R=301,L,NE,QSA]
</IfModule>
# -- concrete5 urls end --
mesuva replied on at Permalink Reply
mesuva
That's the kind of redirect I'm referring to.

There are lots of different ways that it can be configured, it's really just about ensuring you keep the concrete5 specific code in place (your first code example), and adding in the redirects in a way that it doesn't break that.

I often use something like the following to enforce both www AND https
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
        RewriteCond %{SERVER_PORT} 80 
        RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
        RewriteCond %{HTTP_HOST} !^www\.
        RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge
        RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
</IfModule>


But it all comes down to what you are specifically needing to do. I'd make sure your site is all running fine, and leave adding any redirects as a last step before going live.
Elstud replied on at Permalink Reply
Elstud
I am not sure..
If I modify your code as I think applying my domain .. It doesn't work anymore ..
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
        RewriteCond %{SERVER_PORT} 80 
        RewriteCond %{REQUEST_URI} !\.dev.mywebsite.com
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
        RewriteCond %{HTTP_HOST} !^www\.
        RewriteCond %{REQUEST_URI} !\.dev.mywebsite.com
        RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME}/index.html !-f
   RewriteCond %{REQUEST_FILENAME}/index.php !-f
   RewriteRule . index.php [L]
</IfModule>


Can you write the code with a domain?
mesuva replied on at Permalink Reply
mesuva
I wasn't suggesting that you would take the code I posted and change it - it's generic code, you shouldn't need to put your domains in it.

The lines with .well-known in them should be left as is, or removed.
(they have been needed in the past to allow SSL certificates to be installed correctly)
Elstud replied on at Permalink Reply
Elstud
It is that I would like to put my subdomain somewhere where it is correct! :)
It is already well configured at the DNS level.
For the modification of the .htacces, even with your example, it is another matter ... so if I had an example with a subdomain, that would help me more :)
mesuva replied on at Permalink Reply
mesuva
I think you need to describe what you are actually doing.

Are you wanting to enforce https?
Are you wanting to enforce www?
Are you wanting to redirect from one domain to another?

Do you even need to modify the htaccess file at this stage? Can you just revert it to the default and work with that?
Elstud replied on at Permalink Reply
Elstud
I have to work on a new development version of an existing site.

I copied the database and the site.
Update the info of this copy to connect the copy of the database.
The idea is to apply an upgrade from concrete and make sure that everything is ok before switching between the 2 versions.

You explained to me that I had to use the htacces to point another domain to the site. For my part, it is a subdomain that I created.
So what would be the lines to enter in the htacces for it to work?
You could simulate this approach with an example subdomain?

thank you for your patience
mesuva replied on at Permalink Best Answer Reply
mesuva
I may have confused you here. To do what you are wanting to do it's really nothing to do with the .htaccess file.

I suggest just using the standard contents (the first example you posted) for now.

Everything to do with pointing domains at a site is to do with server configurations.
Elstud replied on at Permalink Reply
Elstud
Ok Mesuva, thank you very much, I had problems with the Firefox cache disrupting the settings .., I cleaned up and it works quite simply now!