Pretty URL's on temporary server problem [solved]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Pretty URL's on temporary server problem [solved]

Post by Tetsuo »

Hi guys, this one if confusing me.

I'm having a problem with URL references on a client site. I have set up a CMSMS install on temporary url on my server, because a domain name doesn't exist for it just yet and I want to populate the site content in the meantime.

You can view it here: http://213.175.206.16/~durantcr/

I have used the mod_rewrite url_rewriting method as defined here: http://wiki.cmsmadesimple.org/index.php ... l_Settings

You'll notice that page links in the main white navigation at the top (ignore others, they are hard-coded) do not link through correctly.
For example: http://213.175.206.16/~durantcr/testimonials/ doesn't work. However, http://213.175.206.16/~durantcr/index.p ... stimonials does, so the page definitely exists alright.

Here is the kicker though - I have successfully set up this site before on a staging area on another server:
http://durantcricket.usdigital.co.uk/ using the same url methods as above (I'm certain I've not missed anything) and it worked fine. This is why I am thinking it must be to do with the fact that I am using a temporary URL to host the site (with the ~), but I'm not sure what I have to do to get it to play ball. I had to alter my CSS file to reference images properly too, incedently, whereas I didn't have to do that on the stage site.

Something in config.php, I'm assuming? Either that, or I'm going to have to set up the domain for real (www.website.com) to get it to work, as I had done on the stage site mentioned above? I'd rather not have to switch to back to basic URL encoding to test on this server, then switch back at a later point - it will just be a massive headache.

Thanks for reading, cheers
Tetsuo
Last edited by Tetsuo on Fri Sep 18, 2009 3:17 pm, edited 1 time in total.
Pierre M.

Re: Pretty URL's on temporary server problem

Post by Pierre M. »

Hello,

please use System Info to provide relevant extracts of support information.
CMSms notwithstanding, what static rewriting tests (plain old static urls and html pages) have you made so far ? which work ? which do'nt work ?
What is the difference between the two hosting environments ?
What are the relevant extracts of config.php and htaccess ?
What does the rewritelog say...?

Pierre M.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Pretty URL's on temporary server problem

Post by Dr.CSS »

If your setting it up on a temp. server waiting till it gets populated or whatever I don't see the need at this point to worry about pretty URLs, wait till it has a real URL then turn on the pretty URLs...
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Re: Pretty URL's on temporary server problem

Post by Tetsuo »

Hello Pierre
What is the difference between the two hosting environments ?
The hosting settings an environment are the same, just in different locations on the server. As I mentioned, the only difference is the URL.
CMSms notwithstanding, what static rewriting tests (plain old static urls and html pages) have you made so far ? which work ? which do'nt work ?
None. I just have:
$config['url_rewriting'] = 'mod_rewrite';

and I just used the .htaccess example from here: http://wiki.cmsmadesimple.org/index.php ... l_Settings

Here is my CMS system info:
CMS Install Information:

CMS Version
1.6

Installed Modules

CMSMailer
1.73.14

FileManager
1.0

MenuManager
1.6

ModuleManager
1.3

News
2.10

nuSOAP
1.0.1

Printing
1.0

Search
1.6.1

ThemeManager
1.1.1

TinyMCE
2.5.0

Config Information

php_memory_limit:

process_whole_template:
false

max_upload_size:
10000000

default_upload_permission:
664

assume_mod_rewrite:
true

page_extension:

internal_pretty_urls:
false

use_hierarchy:
true

debug:
false

output_compression:
false

root_url:
http://213.175.206.16/~durantcr

root_path:
/home/durantcr/public_html (0755) Success

previews_path:
/home/durantcr/public_html/tmp/cache (0777) Success

uploads_path:
/home/durantcr/public_html/uploads (0777) Success

uploads_url:
http://213.175.206.16/~durantcr/uploads

image_uploads_path:
/home/durantcr/public_html/uploads/images (0777) Success

image_uploads_url:
http://213.175.206.16/~durantcr/uploads/images

use_smarty_php_tags:
false

locale:


default_encoding:
utf-8

admin_encoding:
utf-8
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Re: Pretty URL's on temporary server problem

Post by Tetsuo »

Dr. CSS wrote: If your setting it up on a temp. server waiting till it gets populated or whatever I don't see the need at this point to worry about pretty URLs, wait till it has a real URL then turn on the pretty URLs...
True, but it's going to be a huge hassle for me to do that, as I have hard-coded links in my templates, which I would have to change around between each deployment. It's just not practical, and there must be an easier way to configure the URL's correctly. As I mentioned, the problem is only occurring on this particular type of environment, so it must be to do with the way the CMS is processing URL's.

I'd be surprised no-one else has encountered this problem, as I'm sure there's plenty of us out there who have deployed the CMS onto a temp url before....

Thanks
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Pretty URL's on temporary server problem

Post by tyman00 »

Temp URLS have nothing to do with it. Be sure that your .htaccess file is properly configured and ensure that the URL's in config.php include the temporary url. Please be sure that your temporary development server has all of the proper apache settings configured to work with pretty urls.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Re: Pretty URL's on temporary server problem

Post by Tetsuo »

Hm. I'm sure you're right, I don't pretend to know much about servers and the like.

I'm just unsure about what I have to change to get it to work on this particular URL, as I've used the same (identical except for the server paths, obviously) files and settings as I used on a previous deployment which worked fine. Here is my path settings in my config.php:
#Document root as seen from the webserver.  No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://213.175.206.16/~durantcr';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/durantcr/public_html';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = '/home/durantcr/public_html/tmp/cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/home/durantcr/public_html/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';
And the .htaccess file I am using is the example on this page:
http://wiki.cmsmadesimple.org/index.php ... l_Settings
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Re: Pretty URL's on temporary server problem

Post by Tetsuo »

tyman00 wrote:Please be sure that your temporary development server has all of the proper apache settings configured to work with pretty urls.
As I mentioned, both sites are hosted on the same server, just in different locations and with different URL's. So it won't be to do with apache not being able to use pretty URL's. If it can do it on one, I should be the same on the temp url too.
User avatar
Tetsuo
Forum Members
Forum Members
Posts: 58
Joined: Wed Aug 19, 2009 12:00 pm

Re: Pretty URL's on temporary server problem

Post by Tetsuo »

Update: -

Having contacted my web host technical support, they have told me what I suspected in that the problem is caused by the mod_rewrites on the temp server address. "You have to have the domain resolving to the server", apparently.

If there is a way around it, I can't stick around to find out unfortunately. So I am having to go with Dr. CSS's suggestion of just using the basic encoding for now, then turning on the pretty urls once I have a domain server to resolve to at a later point. At least I hope that will work anyway. Painful process, but ah well.

I'll update this thread again if when I get around to that, I find that (pretty urls screwing up paths on temp server) was the reason. Maybe this will be of use if someone else comes across the same problem.

Thanks all :)

EDIT  - Yep, it worked OK once on a live site :) Hopefully this will be useful if anyone else has problems with the mod_rewrite method on temp URL's
Last edited by Tetsuo on Fri Sep 18, 2009 3:19 pm, edited 1 time in total.
Pierre M.

Re: Pretty URL's on temporary server problem

Post by Pierre M. »

OK, hosting problem, not CMSms.
Pierre M. wrote: CMSms notwithstanding, what static rewriting tests (plain old static urls and html pages) have you made so far ? which work ? which do'nt work ?
It is always a good idea to test the hosting before calling the CMSms support Team.
Please use [solved].

Pierre M.
tyman00
Power Poster
Power Poster
Posts: 906
Joined: Tue Oct 24, 2006 5:59 pm

Re: Pretty URL's on temporary server problem

Post by tyman00 »

You can use internal pretty urls for now. Not perfect but still better than nothing.
If all else fails, use a bigger hammer.
M@rtijn wrote: This is a community. This means that we work together and have the same goal (a beautiful CMS), not that we try to put people down and make their (voluntary) job as difficult as can be.
Post Reply

Return to “CMSMS Core”