Page 1 of 1

[Solved] Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:28 pm
by WebGuy
I've just went live with the website, everything on the "dev" server was perfect with no issues at all.

However, now that I've gone live...I am seeing a forward slash appended to the URL.

http://www.naturalglo.com//Exclusive-Technology/

It all works and I've never seen this happen before...so I really don't want to leave it like this.

Can someone help me find where this is coming from please?

Thanks!

Detail information:

Here is my config.php (I've removed all comments to keep it short):

Code: Select all

<?php
#-----------------
#Behaviour Settings
#-----------------

$config['php_memory_limit'] = '';
$config['process_whole_template'] = true;
$config['debug'] = false;
$config['output_compression'] = false;

#-----------------
#Database Settings
#-----------------

$config['dbms'] = 'mysql';
$config['db_hostname'] = 'db_hostname';
$config['db_username'] = 'db_username';
$config['db_password'] = 'db_password';
$config['db_name'] = 'db_name';
#Change this param only if you know what you are doing
$config["db_port"] = '';

$config['db_prefix'] = 'ng_';
$config['persistent_db_conn'] = false;
$config['use_adodb_lite'] = true;

#-------------
#Path Settings
#-------------
$config['root_url'] = 'http://www.naturalglo.com';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

$config['root_path'] = $_SERVER["DOCUMENT_ROOT"];
$config['admin_dir'] = 'admin';
$config['previews_path'] = '/tmp/cache';
$config['uploads_path'] = '/uploads';
$config['uploads_url'] = $config['root_url'] . '/uploads';


#---------------
#Upload Settings
#---------------

$config['max_upload_size'] = 50000000;
$config['default_upload_permission'] = '664';

#------------------
#Usability Settings
#------------------

$config['use_smarty_php_tags'] = false;
$config['auto_alias_content'] = true;

#------------
#URL Settings
#------------

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

#--------------
#Image Settings
#--------------

$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';

$config['image_uploads_path'] = '/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images'; 


#------------------------
#Locale/Encoding Settings
#------------------------

$config['locale'] = '';
$config['default_encoding'] = 'utf-8';
$config['admin_encoding'] = 'utf-8';

#---------------------------------------------
$config['old_stylesheet'] = false;
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel';
$config['backwards_compatible'] = false;
$config['disable_htmlarea_translation'] = false;
$config['use_Indite'] = true;
?>
And here is my .htaccess file (I'm using mod-rewrite):

Code: Select all


Options +FollowSymLinks -Indexes
RewriteEngine on
# RewriteBase /
 
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
 
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

# No sense advertising what we are running
ServerSignature Off

# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteRule ^.*$ - [F,L] 
# END Filtering

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:32 pm
by JeremyBASS
comment this out...

RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

that should do it... should  ;D

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:35 pm
by Nullig
Also, shouldn't this:

# RewriteBase /

be

RewriteBase /

Nullig

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:38 pm
by JeremyBASS
@Nullig ... un commenting that would be needed if in a subdirectory right?  I think lol

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:47 pm
by WebGuy
Thanks for the quick reply...and there is nothing like overlooking the "obvious"...

However...still doesn't work?

I'm still getting the extra forward slash...www.naturalglo.com//Exclusive-Technology/

I don't really know what else it could be.

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:50 pm
by JeremyBASS
Oh... I see... there are in the links... just remove the front / from the herf sorry... looking now

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:54 pm
by WebGuy
Yes, I'm thinking it might have to do with something in the menu code...

But when you do initially go to the website...type it in the address box

with this: www.naturalglo.com&nbsp; or naturalglo.com (without the /)
it is auto appending / to the URL so you get www.naturalglo.com/ or naturalglo.com/

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:55 pm
by JeremyBASS
this is the only thing I see ...

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

is above the hack gards, and

and I always put

#------------
#URL Settings
#------------

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '/';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';

hope that helps

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 4:56 pm
by JeremyBASS
no when I went to your site

http://www.naturalglo.com/

was

http://www.naturalglo.com/
thats normal


but your base looks like this...




so it's not your menu...


and all links etc have it


did you set that base?

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 5:13 pm
by WebGuy
Got It!

Concerning your question: "did you set that base?"
I'm not sure what you mean?...but I think you were right as I've changed the config.php:
$config['root_url'] = 'http://www.naturalglo.com/'; TO THIS
$config['root_url'] = 'http://www.naturalglo.com';

I guess I thought I changed it, but probably didn't "upload" it...LOL, sorry.
And it's all good now...

Thanks Jeremy for the help (it's always good to have an extra set of eyes sometimes :-)

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 5:21 pm
by WebGuy
Now how does one mark a post as [Solved]?

Do I just enter this [Solved] in the Topic Subject?...or is there some "automatic" way?
I don't see anything in the Message Icon...so I'm asking.

Re: Live Site adding extra "/" to URL -Weirdness for sure?

Posted: Fri Dec 19, 2008 6:07 pm
by JeremyBASS
glad you got it going... for the solved, just modify the first post title...


have a great day....

jeremyBass