None of my links work
Permalink
Hi,
I've just been asked to take over a site developed using Concrete 5. I've unzipped the files, created the MySQL database and uploaded the contents. I've configured the database settings.
When i open the site everything looks fine until i click on any of the links in the navigation bar at the top of the page. None of them work. The links that are there, don't appear to be absolute. i.e. 'about_us' - there is no about_us file / page, so is there some configuration file you use for constructing and managing links?
I've just been asked to take over a site developed using Concrete 5. I've unzipped the files, created the MySQL database and uploaded the contents. I've configured the database settings.
When i open the site everything looks fine until i click on any of the links in the navigation bar at the top of the page. None of them work. The links that are there, don't appear to be absolute. i.e. 'about_us' - there is no about_us file / page, so is there some configuration file you use for constructing and managing links?
Thanks for your reply.
I'm testing this out using Uniserver locally.
canonical URL's are off as are pretty url's. I've cleared the cache, but still have problems.
in my site.php i have set :
define('BASE_URL', 'http://localhost');
define('DIR_REL', 'mysite');
But if i hover over a link on the navigation bar at the top, instead of the link being localhost/mysite/about_us it's just pointing to localhost/about_us so it seems to be completely ignoring DIR_REL?
I know this file is being used as it has my MySQL connection settings in there and the site won't load without these settings..
I must admit i'm used to coding from scratch, so i'm not used to seeing links to pages that aren't absolute, i.e. 'About Us' linking directly to an about_us.php file...
I'm testing this out using Uniserver locally.
canonical URL's are off as are pretty url's. I've cleared the cache, but still have problems.
in my site.php i have set :
define('BASE_URL', 'http://localhost');
define('DIR_REL', 'mysite');
But if i hover over a link on the navigation bar at the top, instead of the link being localhost/mysite/about_us it's just pointing to localhost/about_us so it seems to be completely ignoring DIR_REL?
I know this file is being used as it has my MySQL connection settings in there and the site won't load without these settings..
I must admit i'm used to coding from scratch, so i'm not used to seeing links to pages that aren't absolute, i.e. 'About Us' linking directly to an about_us.php file...
What version of c5 core? From the defines, it looks like 5.6.x or earlier....
You could post the content of config/site.php , obviously with database login sanitized so you don't give away any security details.
Do you have an .htaccess copied from the old location? That would screw things up.
Try commenting out both the define lines you refer to. (They may be needed on 5.4)
You could post the content of config/site.php , obviously with database login sanitized so you don't give away any security details.
Do you have an .htaccess copied from the old location? That would screw things up.
Try commenting out both the define lines you refer to. (They may be needed on 5.4)
# concrete5 Version
Core Version - 5.7.5.8
I've renamed the .htaccess file to prevent it being loaded
The first link 'About Us' links to localhost/about-us which won't work as it should be /localhost/mysite/about-us
The other links include the /mysite/ in the path but don't work either, i just get page not found.
The site.php is actually located in the root of the site files that i received. I have a application and a concrete folder from the root, both have config folders but no site.php within them...
site.php :
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', '****');
define('DB_PASSWORD', '******');
define('DB_DATABASE', 'mysitedb');
define('FORM_BLOCK_SENDER_EMAIL', '********');
//define('BASE_URL', 'http://localhost/');
//define('DIR_REL', 'mysite');
?>
Core Version - 5.7.5.8
I've renamed the .htaccess file to prevent it being loaded
The first link 'About Us' links to localhost/about-us which won't work as it should be /localhost/mysite/about-us
The other links include the /mysite/ in the path but don't work either, i just get page not found.
The site.php is actually located in the root of the site files that i received. I have a application and a concrete folder from the root, both have config folders but no site.php within them...
site.php :
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', '****');
define('DB_PASSWORD', '******');
define('DB_DATABASE', 'mysitedb');
define('FORM_BLOCK_SENDER_EMAIL', '********');
//define('BASE_URL', 'http://localhost/');
//define('DIR_REL', 'mysite');
?>
That site.php will be dead data from an earlier web site that ran on an earlier c5 version. Its nothing to do with 5.7.5.8. If processed by this site (I don't think it is), it would be doing nasty stuff. To prove that, rename the file to site.php.legacy and your site should either run the same (then once proven, delete it).
All the configuration data will be in files beneath /application/config
Database connection in /application/config/database.php
Other stuff in files:
/application/config/app.php
/application/config/generated_overrides/*.php
All the configuration data will be in files beneath /application/config
Database connection in /application/config/database.php
Other stuff in files:
/application/config/app.php
/application/config/generated_overrides/*.php
Ok, i've renamed that file, i've tried uploading the site to godaddy, made sure all the relevant foldes are writable etc..
Just 2 problems remain.
uploaded images are using the root path (iehttp://mysite.com) and not (http://mysite/test/) for example.
Navigation links work but only ones that have options beneath them. Any direct links to Home or About Us etc point to the root path and not the root + site path.
Do i need to alter a setting in app.config?
Thanks for all your help.
Just 2 problems remain.
uploaded images are using the root path (iehttp://mysite.com) and not (http://mysite/test/) for example.
Navigation links work but only ones that have options beneath them. Any direct links to Home or About Us etc point to the root path and not the root + site path.
Do i need to alter a setting in app.config?
Thanks for all your help.
I don't know, so much depends on your server environment and how the site was set up.
GoDaddy hosting is often the source of problems for c5 sites and has a poor reputation as the bargain sale hosting company. Better off spending a few $ more on a more reputable shared hosting package.
GoDaddy hosting is often the source of problems for c5 sites and has a poor reputation as the bargain sale hosting company. Better off spending a few $ more on a more reputable shared hosting package.
ok well thanks anyway. I find GoDaddy are fine for all the other sites i've either written or look after...
I've never had a site before where i've had to mess about with .htacess files just to get it to work... only for basic requirements like logins etc.
Navigation should be a really basic thing to setup and configure, everything in C5 seems to be buried away somwhere. I don't really get why it doesn't just use the path where the site resides and use that as a base url.... doesn't really make any sense to me...
I must say i don't find any of the C5 admin pages intuitive at all, but then i've never been a great fan of Wordpress, Joomla etc... Having to rely on other peoples code has never been a good idea in my opinion.
I've messaged the previous hosts, hopefully they'll come back with some ideas.
I've never had a site before where i've had to mess about with .htacess files just to get it to work... only for basic requirements like logins etc.
Navigation should be a really basic thing to setup and configure, everything in C5 seems to be buried away somwhere. I don't really get why it doesn't just use the path where the site resides and use that as a base url.... doesn't really make any sense to me...
I must say i don't find any of the C5 admin pages intuitive at all, but then i've never been a great fan of Wordpress, Joomla etc... Having to rely on other peoples code has never been a good idea in my opinion.
I've messaged the previous hosts, hopefully they'll come back with some ideas.
If you do a fesh install with sample content in another subdirectory, you can compare the config files and work out the differences to what your current install does.
With caches cleared, a regular autonav should sort itself out. However, there are non-approved themes and navigation that do not follow the usual rules in the way they build links, so won't move easily. Its also possible the navigation was assembled manually with links coded into it.
Once you have it running with correct links, you can re-enable pretty URLs and the caches.
When making a copy of a site (the 'cop'y part, not the 'paste' part), the best policy is to disable caches and pretty URLs before exporting the database and zipping up the files, then re-enable. That way, its already clean when you do the 'paste' and import to a new database