Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How To Hide Your Development Site


morehawes

Recommended Posts

I like to hide my development site from the outside world, especially when I am building it under new.the_domain.co.uk. I'm sure everyone has their way of doing this if they so choose but I thought I would share the method I came up with. As well as blocking the site on robots.txt (just in case!):

 

User-agent: *
Disallow: /

 

I add the following code to the bottom of includes/application_top.php:

 

//START Show new shop to allowed visitors (i.e. catalog/?keyword=1)
if(@$_SESSION['keyword'] != 1){	//if session variable not set
if(@$_GET['keyword'] == 1){	//check if get variable set
	tep_session_register($_SESSION['keyword']);	//if it is then set session variable
	$_SESSION['keyword'] = 1;
}else{	//otherwise die
	die;	
}
}
//END Show new shop to allowed visitors

 

The logic is test if a session variable has been set for your keyword to let you see the site, if it hasn't been set then check if it has been appended to the URL, if it has then create the session variable and continue. If it's not there then stop PHP from any other output.

 

So when you access your development site with ?keyword=1 on the end of the URL e.g. new.the_domain.co.uk/catalog?keyword=1 you are let in (until the session expires) but everyone else just gets a blank screen.

 

I'm not saying this is a particuarlly great method but just one that I have found very useful! If anyone has any additional tips that would be super!

Joe

 

MacMan strikes again!

 

Always backup first before listening to me!

Link to comment
Share on other sites

the domain name should be submitted to search engines or advertised before anyone will know it.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

the domain name should be submitted to search engines or advertised before anyone will know it.

 

Thats true if you have a completely new site, but if you are developing a site for an existing domain on new.my_domain.co.uk or test.my_domain.co.uk then it's useful to be able to hide it from nosey people. Or maybe thats just me! :P

Joe

 

MacMan strikes again!

 

Always backup first before listening to me!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...