• 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




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Useful hint for maintenance mode
PostPosted: Mon Jul 03, 2017 4:05 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Feb 20, 2008 4:33 pm
Posts: 58
Location: London, England
While testing a new website on our staging server we found a problem that may have affected other devs.

The scenario is that you have a site on a staging server, the site has many links to external pages that are running google analytics. This in itself is fine until you start testing the links and google finds your staging site. again not a problem if you have set your robots.txt to disallow /*, but what about if you didn't and the site has now been indexed! all 700 pages of it!

Well firstly set the robots.txt and the header of each page with:
Code:
<?php header('X-Robots-Tag: noindex,noarchive,nofollow'); ?>

This will help any further crawls.

You can then put the site into maintenance mode in the [Site Admin->Settings - Global Settings->Maintenence Mode]

set the "Down for Maintenance" to Yes

now the site will be down for external users. You can add the testers IP addresses to the "Exclude these IP addresses" field.

Then they can test away without letting google index the site.

Now!

what happens when you want to use the CMSMS Linker plugin on the MicroTiny WYSIWYG editor, answer is it won't work in maintenance mode.

"I know that sucks" I here you say, not so, as this is a security feature after all and how secure would it be if it allow ajax calls while in maintenance mode.

The solution is simple, add the server IP to the "Exclude these IP Addresses" field this allows CMSMS Linker to make the ajax calls to the server and return the correct links.

I also discovered that the same issue befalls the PDFGenerator Module as it requires the module to make a call to build the PDF for output and returns a blank PDF, but not anymore.

I am sure there will be other occasions that this would be the case and hope that it will stop you scratching your heads and getting frustrated.

it's all good and we can move forward

Mark


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Useful hint for maintenance mode
PostPosted: Mon Jul 03, 2017 5:06 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Apr 23, 2008 7:53 am
Posts: 7540
Location: The Netherlands
Installing SitemapMgr gives you the possibility to edit your robots.txt file from out the Admin panel.
http://dev.cmsmadesimple.org/projects/sitemapmgr

You can put this line in the metadata field in Global Settings once
Code:
<meta name="robots" content="noindex, nofollow">
When having the {metadata} tag in the page head, it will be automatically added to all pages.

_________________
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! [ Click here ]



Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Useful hint for maintenance mode
PostPosted: Mon Jul 03, 2017 5:09 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7951
Location: Fernie British Columbia, Canada
FYI: <?php tags are not allowed or supported in any templates.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: Useful hint for maintenance mode
PostPosted: Tue Jul 04, 2017 8:41 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Feb 20, 2008 4:33 pm
Posts: 58
Location: London, England
#### UPDATE ####

due to a fopar in my code addition pointed out by @Calguy1000 the following code should be replaced:
Quote:
Well firstly set the robots.txt and the header of each page with:
Code:
<?php header('X-Robots-Tag: noindex,noarchive,nofollow'); ?>


With

Install MetaMax and go to "Page title & Meta information" tab "Meta content" section and select the noindex, nofollow option from the dropdown.

that will do the trick.

It is possible to add the php header to the templates by using a UDT and addin
Code:
header('X-Robots-Tag: noindex,noarchive,nofollow');

if thats your preference.

happy coding


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:  
A2 Hosting