• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Staging site copy of live site: only home page accessable
PostPosted: Thu Feb 07, 2019 9:05 am 
Offline
Forum Members
Forum Members

Joined: Fri May 06, 2011 12:48 pm
Posts: 213
Greetings.

I copied a live site to my staging server and the admin works fine and the home page works fine, but the inner pages are giving an error

Code:
"The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies."


I believe it must be a config issue. I have tried:
  • changed the [root_url] in the config file
  • removed https stuff from htaccess file
  • turned off pretty urls

Any ideas of what i should be looking at in the config files?

Code:
<?php
$config['dbms'] = 'mysqli';
$config['db_hostname'] = 'localhost';
$config['db_username'] = '*****';
$config['db_password'] = '*****';
$config['db_name'] = '*****';
$config['db_prefix'] = 'cms_';
$config['root_url'] = 'http://some.staging.domain';
$config['default_encoding'] = 'utf-8';
$config['url_rewriting'] = 'mod_rewrite';
?>


Code:
# This file is specific to Apache configurations.
# It attempts to optimize traffic and configuration for your CMS Made Simple website.
# Many options are disabled by default as some providers do not allow you to override some of these settings in the .htaccess file.

#
# Attempt to override some PHP settings.
# These settings may be helpful on some hosts if your default configuration does not meet CMSMS's minimum requirements,
# and your host has given your account appropriate permissions.
#
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"
#php_value session.cookie_httponly true
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

#
# Disallow directory indexes. This can be an important security enhancement
#
Options -Indexes

#
# Don't allow the browser to know the type of signature.
#
ServerSignature Off

#
# Allow the Apache server to follow symbolic links.  This is usually not necessary.
#
#Options +FollowSymLinks

#
# To prevent E_STRICT problems with PHP 5.3+ you can uncomment the following lines
# Note: These settings should only be enabled for production sites!
#
#php_flag display_startup_errors 0
#php_flag display_errors 0
#php_flag html_errors 0
#php_value docref_root 0
#php_value docref_ext 0

#
# The following is to enable pretty URLS, only applicable if url_rewriting is set to 'mod_rewrite' in the config.php
#
<IfModule rewrite_module>
RewriteEngine on
# If your CMSMS installation is in a subdirectory of your domain, you may need to specify the relative path (from the root of the domain) here.
# i.e: RewriteBase /cmsms
RewriteBase /

# Rewrites urls in the form of /parent/child/grandchild 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]
   
#Force HTTPS
#RewriteCond %{HTTP_HOST} ^somelivedomain\.com [NC]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.somelivedomain.com/$1 [R,L]
</IfModule>



#
# The following are highly recommended security settings for files in your CMSMS install that should not be browsed directly
#
<Files ~ "\.htaccess">
  Order allow,deny
  Deny from all
</Files>
<Files ~ "\.ini$">
  Order allow,deny
  Deny from all
</Files>
<Files ~ "\.log$">
  Order allow,deny
  Deny from all
</Files>
<Files ~ "config\.php">
  Order allow,deny
  Deny from all
</Files>
<Files ~ "/lib/*php">
  Order allow,deny
  Deny from all
</Files>

RedirectMatch 403 ^/.*\.htaccess$
RedirectMatch 403 ^/.*\.log$
RedirectMatch 403 ^/.*\.ini$
RedirectMatch 403 ^/.*config\.php$
RedirectMatch 403 ^.*/doc/.*$
RedirectMatch 403 ^.*/lib/.*\.php$
RedirectMatch 403 ^.*/tmp/.*\.php$
RedirectMatch 403 ^.*/plugins/.*\.php$
RedirectMatch 403 ^.*/modules/.*\.php$
RedirectMatch 403 ^.*/uploads/.*\.php$

# The following are performance optimizations and security enhancements for content that is served by your CMSMS installation.
#
<IfModule mod_headers.c>
        # Disable Last-Modified for performance
        Header unset Last-Modified
   # Disable ETags
   Header unset ETag
   FileEtag None
   # For Security
   Header set X-Frame-Options "SAMEORIGIN"
</IfModule>

#
# The following setups compression for content, if compression is enabled on the server.
#
<IfModule deflate_module>
   AddOutputFilterByType DEFLATE text/html text/css text/plain text/html text/xml image/gif image/jpeg image/png image/ico text/javascript application/x-javascript application/javascript application/json application/pdf
</IfModule>

#
# The following allows the browser to cache images, scripts, stylesheets and videos.  If the expires module is enabled on the server.
#
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
# Set expires tags on various file types... so that the browser wont attempt to reload them.
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/ico "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType video/x-flv "access plus 1 year"
ExpiresByType application/pdf "access plus 1 year"
ExpiresByType application/x-shockwave-flash "access plus 1 year"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
   <IfModule mod_headers.c>
      # Setting cache control to public allows proxy servers to cache the items too.
      Header set Cache-Control "public"
   </IfModule>
</IfModule>


Last edited by wmdvanzyl on Thu Feb 07, 2019 9:14 am, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 9:13 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7636
Location: The Netherlands
You still need to update this:
Quote:
#Force HTTPS
#RewriteCond %{HTTP_HOST} ^somelivedomain\.com [NC]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.somelivedomain.com/$1 [R,L]

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 9:15 am 
Offline
Forum Members
Forum Members

Joined: Fri May 06, 2011 12:48 pm
Posts: 213
Rolf wrote:
You still need to update this:
Quote:
#Force HTTPS
#RewriteCond %{HTTP_HOST} ^somelivedomain\.com [NC]
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.somelivedomain.com/$1 [R,L]


Thanks Rofl - i always appreciate your input. Are you saying that i can't leave it commented out as it is now? Is it required to be in?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 9:17 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7636
Location: The Netherlands
You can leave it in, but you have to update the URL!
Quote:
http://some.staging.domain

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 9:35 am 
Offline
Forum Members
Forum Members

Joined: Fri May 06, 2011 12:48 pm
Posts: 213
Rolf wrote:
You can leave it in, but you have to update the URL!
Quote:
http://some.staging.domain


Ok, but right now it's commented out. Notice the '#' before the line. My question is; can't i just leave those lines out?

EDIT: I have removed the htaccess file compeltely and the issue persists,


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 9:43 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7636
Location: The Netherlands
Ohw duh... my bad, sorry! :D

Did you clear cache yet? Empty the content of the folder tmp/cache and tmp/templates_c?

And also try to clear your browser cache/history

_________________
Image

Did my post help you solving a problem at your (customers) website and it saved you many hours of work? Great!! Consider buying me a cup of coffee in return!



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 10:10 am 
Offline
Forum Members
Forum Members

Joined: Fri May 06, 2011 12:48 pm
Posts: 213
Finding more pieces of the puzzle. I just started the entire process again from the start. I also noticed that i have no styling on the admin panel after logging in. As soon as i do the first upgrade of CMSMS versions, the styling returns. I'm not sure whether that is relevant to the current issue, but it's worth mentioning.

EDIT:

(domains replaced for security)

Code:
<b>Fatal error</b>:  Uncaught exception 'LogicException' with message 'Attempt to set headers, but headers were already sent at: /home/foo/sub.domain.com/admin/style.php::2' in /home/foo/sub.domain.com/lib/misc.functions.php:1229
Stack trace:
#0 /home/foo/sub.domain.com/lib/include.php(75): setup_session()
#1 /home/foo/sub.domain.com/admin/style.php(25): require_once('/home/foo/rec...')
#2 {main}
  thrown in <b>/home/foo/sub.domain.com/lib/misc.functions.php</b> on line <b>1229</b><br />


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Staging site copy of live site: only home page accessabl
PostPosted: Thu Feb 07, 2019 3:52 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 644
Location: Victoria, BC
As well as removing the htaccess, make sure to comment out url_rewriting in the config, then clear the cache.

Then visit the site in incognito mode and/or use browserstack (or similar) to ensure it's not something cached on your computer. If you can get it to work without pretty urls, then you can start working your htaccess back in. Just make sure to test in a new incognito session each time, clearing the cmsms cache between every change.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting