From LOCALHOST to LIVE: broken paths...

Permalink 1 user found helpful
Hi community! I could definitely use some help here :)

I installed C5 (v5.5) on my localhost (MAMP environment) and played with some very basic C5 features: it works like a charm, really love it.

Before going too far in my local development i wanted to make sure that everything was working the same way LIVE! So I uploaded the whole structure online, made the DB info and the BASE_URL change in site.php AND also made the RewriteBase change in .htaccess (for pretty URLs)

The site "localhost" URL is:
http://localhost/2012-01-the-enchanted-forest/...

The site "live" URL is:
http://www.enchantedforestbc.com/temp/...

The former "live" URL works fine: it displays the homepage, allows login and shows the edit/dashboard menus, BUT...

ISSUE #1:
When I click any link in the nav menu and go to a subpage like:
http://www.enchantedforestbc.com/temp/about-us/...

the site displays itself totally broken: no CSS, no edit/dashboard menus, etc.)

So I checked the source code and, indeed, found the path to main.css being:
/temp/about-us/index.php/tools/css/themes/default/main.css
instead of:
/temp/index.php/tools/css/themes/default/main.css

Same story for every link in the source code.
No idea where that "relative path" error comes from...

ISSUE #2:
On the homepage, the one (and only one) that displays correctly, from time to time and randomly, when I try to edit some content, instead of getting the rich-text editor I got an error message instead: "Access denied". I hope these 2 issues are linked.

Any suggestions? Please? :)

stephanebeck
View Replies: View Best Answer
JohntheFish replied on at Permalink Reply
JohntheFish
Could be the .htaccess file.
stephanebeck replied on at Permalink Reply
stephanebeck
Here's how I've modified the .htaccess (the same way C5 created it in my local environment):

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /temp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
Korvin replied on at Permalink Reply
Korvin
Are you certain that mod_rewrite is enabled?
Korvin replied on at Permalink Reply
Korvin
Hey there, it looks like your site isn't loading any external resources. This is a due to your .htaccess being malformed. (http://www.enchantedforestbc.com/temp/index.php/about-us/) Try cycling Pretty URLs on and off.

Best Wishes,
Korvin

Concrete5 Team
stephanebeck replied on at Permalink Reply
stephanebeck
Thanks for the replies Korvin.
Yes, mod_rewrite is enabled.

I did a few tests:

With “pretty URLs” disabled:
- Issue #1 (solved): I can navigate every page of the site properly (no more path issues)
- Issue #2 (extended): I got a very random “Access denied” message when I try to add blocks to areas or edit any existing block (and I’m logged in as admin)
- Issue #3 (new): Randomly again, when I “exit edit mode” C5 logs me out completely! When I log in again I’m sent to the homepage instead of staying on the page I’ve logged in from and (sometimes) when I try to go back on the page I logged from, I’m logged out again.
- I don’t have pretty URLs!

With “pretty URLs” re-enabled (.htaccess updated successfully):
- Issue #1 (re-appears, unchanged): path problem (see initial post)
- Issue #2 (limited to homepage, as it’s the only one accessible)
- Issue #3 (limited to homepage, as it’s the only one accessible)

Lots of random behaviors for the very same scenarios I repeated several times, it seems there’s no logic… I’m confused.
I’m running v5.5. and I cleared the cache twice but it doesn’t seem to be related to these issues.

S.O.S :)

PS: I noticed the following PHP errors in the “environment” page (dashboard > System & Settings):

- Warning: Cannot modify header information - headers already sent by (output started at /home/enchant/public_html/temp/concrete/controllers/dashboard/system/environment/info.php:1) in /home/enchant/public_html/temp/concrete/libraries/view.php on line 841

- <b>Warning</b>: set_time_limit() [<a href='function.set-time-limit'>function.set-time-limit</a>]: Cannot set time limit in safe mode in <b>/home/enchant/public_html/temp/concrete/controllers/dashboard/system/environment/info.php</b> on line <b>7</b>
Mnkras replied on at Permalink Reply
Mnkras
Disable PHP safemode.

I bet that is causing the issue.
stephanebeck replied on at Permalink Reply
stephanebeck
Thanks for the try Mnkras. Indeed safe_mode was ON and I turned it OFF but it doesn't seem to solve any of the issues reported above. Any other idea?
Mnkras replied on at Permalink Best Answer Reply
Mnkras
Ok, I see the issue,

in the site.php, inside the <?php ?> add these 2 lines.

define('BASE_URL', 'http://www.enchantedforestbc.com');
define('DIR_REL', '/temp');


when you move the site to the root, change the DIR_REL line to this:

define('DIR_REL', '');


This should be fixed in the next version of c5.

Mike
stephanebeck replied on at Permalink Reply
stephanebeck
Thanks Mike, you fixed it! Good karma for you!

However I still want to report the following issues (is there a dedicated place to report issues and suspected bugs?) for general information:

- Sometimes, and randomly, when I “exit edit mode” C5 logs me out completely.

- Doesn't matter which page I try to log in from (to edit it), I'm sent back to the homepage

Thanks again
Mnkras replied on at Permalink Reply
Mnkras
You can post bugs here:http://www.concrete5.org/developers/bugs/...

I can tell you that #2 is not a bug.

Thanks
Mike
stephanebeck replied on at Permalink Reply
stephanebeck
...and I insist on the fact that none of these issues appear in my local environment: everything works perfectly.