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.
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.
your main domain is also unreachable. Are you sure you have that spelled correctly?
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
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
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)
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)
Ok, I understand, but what should I add in the. htacces?
Currently I have this:
I just try this and It works, but maybe I left too many lines?
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 --
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
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.
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>
Viewing 15 lines of 16 lines. View entire code block.
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.
I am not sure..
If I modify your code as I think applying my domain .. It doesn't work anymore ..
Can you write the code with a domain?
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>
Viewing 15 lines of 16 lines. View entire code block.
Can you write the code with a domain?
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)
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)
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 :)
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 :)
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?
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?
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
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
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.
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.
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!