move C5 code, images and references up to docroot

Permalink
I have installed, configured and built a site on Concrete 5.5.2.1 and it is all working well. I have a problem that I have a URL of
www.ayrshireminis.com/concrete5.5.2.1
, for example, which is where the index.htm file sits. Is there a way that I can bring the code back up to the docroot without breaking all references such as image paths in the database for example?

Considering that the download of Concrete 5 includes this directory I am assuming that this is a common issue for some developers when using this CMS.

crmpicco
 
citytech2 replied on at Permalink Reply
citytech2
Hi
You can use .htaccess 301 redirect to solve this issue.

Citytech
crmpicco replied on at Permalink Reply
crmpicco
I'm not sure what you mean. I should stress that the files themselves are in a directory called /concrete5.5.2.1 in my docroot. The references in the database to images, paths etc I would imagine to also be pointing to /concrete5.5.2.1 - how would you suggest solving this with .htaccess?

For SEO purposes, amongst other things, I wouldn't want to have
www.ayrshireminis.com/concrete5.5.2.1/contact
in the url I would want this to be
www.ayrshireminis.com/contact


Do you have an example of configuring this with .htaccess?
citytech2 replied on at Permalink Reply
citytech2
Hi
You can try this:
RewriteEngine On
RewriteRule ^concrete5.5.2.1/(.+)$ http://www.ayrshireminis.com/$1 [R=301,L]


Let me know if it works or not.

Citytech
crmpicco replied on at Permalink Reply
crmpicco
OK, thanks for sending this through. I am familiar with .htaccess, however can you advise if Google will crawl this and index the /concrete5.5.2.1?
citytech2 replied on at Permalink Reply
citytech2
As per my knowledge, Google will not indexing the concrete5.5.0.1 phase. May be I'm wrong, so any other C5 member having better knowledge can assist you.

Citytech
crmpicco replied on at Permalink Reply
crmpicco
One issue would be that the links would be something like
www.ayrshireminis.com/concrete5.5.2.1/contact
when you navigated around the site. I don't think this would look good.
JohntheFish replied on at Permalink Reply
JohntheFish
You could attack the problem from the other end. Change the domain mapping to point the domain at the directory where index.php resides.

You may have to make some small changes to .htaccess and possibly also to config/site.php. But as long as you have used the correct C5 mechanisms for specifying links throughout your site, the links will sort themselves out.

Be sure to turn off pretty urls and the cache while making the change and re-enable once everything is stable later.
crmpicco replied on at Permalink Reply
crmpicco
I'm currently moving all the C5 code to the webroot, so that'll be the index.php and the /blocks /concrete /config directories.

This is my config/site.php - is there somewhere that I should be changing the default site root directory or does this not exist in this version of Concrete 5? (I'm using 5.5.2.1).

<?php 
define('DB_SERVER', 'sql209.xxx.com');
define('DB_USERNAME', 'b9_10658382');
define('DB_PASSWORD', 'mypasswordinhere');
define('DB_DATABASE', 'b9_10658382_xxxxxxx');
define('PASSWORD_SALT', 'mysaltedpassword');


I've decided against using .htaccess to re-write the URL as my URLs from within the application would still include /concrete5.5.2.1 and I don't want that as you can imagine.