Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

“No tracking” code?

website coding

  • Please log in to reply

#1
BerDov

BerDov

    Member

  • Member
  • PipPipPip
  • 228 posts

Hello all,

I am not sure if this is the right forum. If not, please advise.

I have a web site (I am a pro photographer) designed from scratch using just the html code, no fancy stuff.

I would like to create a private directory, e.g. /personal/ to post family photos and other personal stuff that will not be accessible without a password, and that will not be open to search engines to index.

Googling “no google tracking code” produced nothing, except few suggestion how to achieve exactly the opposite.

Are there code examples anywhere that I could try to adopt to my needs? I am not a programmer but assume this task is doable.

Thank you!

 


  • 0

Advertisements


#2
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Hello all,

I am not sure if this is the right forum. If not, please advise.

I have a web site (I am a pro photographer) designed from scratch using just the html code, no fancy stuff.

I would like to create a private directory, e.g. /personal/ to post family photos and other personal stuff that will not be accessible without a password, and that will not be open to search engines to index.

Googling “no google tracking code” produced nothing, except few suggestion how to achieve exactly the opposite.

Are there code examples anywhere that I could try to adopt to my needs? I am not a programmer but assume this task is doable.

Thank you!

 

Might take a look at these if you haven't already:

 

12 Ways to Keep Your Content Hidden from the Search Engines

 

Preventing your site from being indexed, the right way

 

The only problem with some of these methods is that it depends on whether they are honored by the search engines. Some will; some will not and will index your site. Java use has gone with the Neanderthals. I would suggest using CAPTCHA, User/Password or NoFollow HTML tag.

 

For a photo album set up, I like using JAlbum. No affiliation with them but used theit software many times. They have many great free themes for displaying photos. All are coded for responsive website design.


  • 0

#3
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Thank you, AstraNut, I will follow your suggestions, will see how much I can do.


  • 0

#4
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Thank you, AstraNut, I will follow your suggestions, will see how much I can do.

You're welcome. Let me know if there's something else I might be able to help with. I haven't kept up with HTML5 and CSS3 in close to a year but might be able to help with coding.


  • 0

#5
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Thank you again AstraNut,

 

It looks like I do need a bit of help.

 

When reading "12 Ways to Keep Your Content Hidden from the Search Engines", I understood that password protection (which I wanted anyway) is all I need since it "will effectively prevent any search engines from accessing content".

 

So, I searched for "hot to create password" and chose the wikihow page at https://www.wikihow....tect-a-Web-Page

Its Step 1 is to create a text file caleld < .htpasswd>. However, my PC does not allow creating a text file without the  .txt extension.  (when I created a .htpasswd.txt and tried to copy it on the web server, it did not accept it, of course).

 

So, I went to my web site. It can be accessed with Expression Web. I use a very old Version 3, but it still works with Win 7.

 

Then I went to File > New > ... which gives options for  > Page , HTML, ASPX, ASP, PHP, CSS.

 

So, where do I begin?

 

:)


  • 0

#6
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

First, the .htaccess file is a server file (Apache Web Server). It may already be in the root folder of your web site. Editing it is best done using the Control Panel's online editor as editing on a computer using a  text editor, like Notepad++ or an HTML editor like CoffeeCup's (CC's) editor (or similar), may give you problems uploading the file to correct directory. I have used CC's editor. Usually, you can create and edit .htaccess locally on your computer and then upload it to your site via FTP. I've used FileZilla although there are other FTP programs. 

 

I don't know which file extension you are using for your site. I've used HTML, SHTML and PHP. There are other types as you've noted. Running PHP on your computer for complete site can be done with XAMPP or WAMP (XAMPP, I think is easier for beginners).

 

Might want to look at What is .htacess to get more familiar with it. The Password protection is here.

 

Are you using free or paid hosting? Are you coding with HTML5 and CSS3?

 

You can PM the URL for your site to keep from putting it up on here.


Edited by AstraNut, 21 January 2020 - 04:27 PM.

  • 0

#7
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Thank you kindly! Will look into this tomorrow morning (need fresh mind :)


  • 0

#8
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Thank you kindly! Will look into this tomorrow morning (need fresh mind :)

No problem. Plenty of time as retired.


  • 0

#9
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Sorry for big break. Life took over.

 

I read http://www.htaccess-...o-use-htaccess/enough to start trying first steps.

Still, for whatever reason, I cannot create a .htaccess file on my computer.

 

The web site advises: "You can create a .htaccess file using any good text editor such as TextPad, UltraEdit, Microsoft WordPad and similar (you cannot use Microsoft NotePad)."

 

I have WordPad, but it insists on saving a document with extension, e.g. .rtf , .txt, etc.

 

Studying the web site, I did not see a .htaccess file anywhere. In the admin folder (www.sitename.com/admin), there are many pages which I did not create. Among them, there is one titled <frm-permission.html>.  I do not understand if I can or need to take advantage of it, and how. Please see attached screen shot

 

 

 

So, to summarize, I want to create a directory [www.sitename.com/personal. ] To protect it, a .htaccess file must be placed in the /personal directory. So, how do I create it?

 

Thank you!


  • 0

#10
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Sorry for big break. Life took over.

 

I read http://www.htaccess-...o-use-htaccess/enough to start trying first steps.

Still, for whatever reason, I cannot create a .htaccess file on my computer.

 

The web site advises: "You can create a .htaccess file using any good text editor such as TextPad, UltraEdit, Microsoft WordPad and similar (you cannot use Microsoft NotePad)."

 

I have WordPad, but it insists on saving a document with extension, e.g. .rtf , .txt, etc.

 

Studying the web site, I did not see a .htaccess file anywhere. In the admin folder (www.sitename.com/admin), there are many pages which I did not create. Among them, there is one titled <frm-permission.html>.  I do not understand if I can or need to take advantage of it, and how. Please see attached screen shot

 

 

 

So, to summarize, I want to create a directory [www.sitename.com/personal. ] To protect it, a .htaccess file must be placed in the /personal directory. So, how do I create it?

 

Thank you!

WordPad is not good to use for editing web pages. There is a free HTML Edit at CoffeeCup's website as well as other sites. I use CC's paid version. I would use the free NotePad++ and set it up for HTML. You can use it for writing C++, Perl, JavaScript, and many other languages. There is sometimes only one directory where your own files are suppose to go. It should tell you where your site pages go. Is your site live now or what? If working, then you are in the right directory. Are you using the online editor in your Control Panel? I make my complete site on my computer which mirrors one online so I can keep all the links correct. I can help with this but I need to see the pages.

 

It's hard to make a .htaccess file on your computer then get it uploaded to the correct directory because of the type of file. It can be done but the easiest way is to log into your hosting Control Panel and open the File Manager. Go to directory where you want to put the file and make a new ,htaccess page. Be sure to save after done. I use my HTML Editor to do all my coding and upload/download files to my site.


Edited by AstraNut, 08 February 2020 - 02:04 PM.

  • 0

Advertisements


#11
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Thank you!

 

I tried to find the Control panel on the hosting server ( I use web.com) I could not find it so called tech support. They said that on my old web site, this cannot be done, and that the .htaccess file can be created with NotePad++ and then uploaded to the desired directory via ftp.

 

It is my understanding that NotePad++ is not a part of the OS, so I will find it, download, and try to create a script using htaccess-guide.com as a guide. Will let you know what happens.


  • 0

#12
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Yes, NotePad++ does not come with an OS. It is free and is much, much better than Windows' Notepad. The website: https://notepad-plus-plus.org/. A free HTML Editor which you can set up with FTP and upload/download files from your own site is the free CoffeeCup editor: https://www.coffeecup.com/free-editor/ . You will have to set up the proper server FTP connection. Support should have all that info for you.

 

If web.com is charging you there is a Control Panel for online editing or should be. Free hosting have them.. According to web.com's pricing, the $10/month (Starryer) for 1 webpage is outrageous! There are better hosting sites with a lot of features. Many even have way more features and are free! I would have used WordPress before I ever used web.com. My free hosting site has more features and an online Control Panel (don't use it though since I have CC's editor).

 

If you get the free editor, you really don't have to get NotePad++ but I would. Then you can set your files to be opened and edited by it. The Context Menu (right-click a file) will have something like Edit with Notepad++.


Edited by AstraNut, 08 February 2020 - 04:02 PM.

  • 0

#13
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

I downloaded NotePad++ and created an <.htaccess> file with one line reading <test file>.

 

On the web server, I then created a directory /html/testpass/ with one html page (via MS Expression) an one jpg file (via FileZilla), just to see that it works.

 

However, uploading the <.htaccess> via FileZilla is not working. It flashes for a split second in the pane that shows the contents of /testpass/ directory and then disappears.

 

Yesterday, I spent over an hour on the phone with web.com 1st tier tech support. Unfortunately, the woman was not very knowledgeable. She went to ask for advice of "senior people", then started guiding me through Control Panel, but then (I swear I felt it) got scared and switched back to ftp which still did not work. She then said that, because the site was self-designed, I could buy 30 min for $59.99 which should be enough for senior staff to create a password for me.

 

Just now, I logged in to my account on web.com and tried to find the /testpass/ directory, for which I would try to create a password.  There was no clear way to do this that I could see, I did not want to mess up something accidentally and left.

So, there are three questions now.

 

1. Why do I not see the <.htaccess> on the web server? (and neither could the tech support woman - if I understood her right).

 

2. How can I create a password using the Control Panel?

 

3. Anything else that I am not aware of?

 

Thank you!


  • 0

#14
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

I downloaded NotePad++ and created an <.htaccess> file with one line reading <test file>.

 

On the web server, I then created a directory /html/testpass/ with one html page (via MS Expression) an one jpg file (via FileZilla), just to see that it works.

 

However, uploading the <.htaccess> via FileZilla is not working. It flashes for a split second in the pane that shows the contents of /testpass/ directory and then disappears.

 

Yesterday, I spent over an hour on the phone with web.com 1st tier tech support. Unfortunately, the woman was not very knowledgeable. She went to ask for advice of "senior people", then started guiding me through Control Panel, but then (I swear I felt it) got scared and switched back to ftp which still did not work. She then said that, because the site was self-designed, I could buy 30 min for $59.99 which should be enough for senior staff to create a password for me.

 

Just now, I logged in to my account on web.com and tried to find the /testpass/ directory, for which I would try to create a password.  There was no clear way to do this that I could see, I did not want to mess up something accidentally and left.

So, there are three questions now.

 

1. Why do I not see the <.htaccess> on the web server? (and neither could the tech support woman - if I understood her right).

 

2. How can I create a password using the Control Panel?

 

3. Anything else that I am not aware of?

 

Thank you!

You must use the proper syntax when making a .htacess file. "<test file>" will not be seen nor command the server to do anything. I am assuming they use Apache so Apache's .htaccess configuration file needs to use Apache commands.

 

I thought they told you that you had no Control Panel. :P I knew you had one. The best way is to use the Control Panel's (CP) editor and save using FTP. The period that starts the file name will keep the file hidden within the folder. You will be able to see and edit it using the CP's editor or using a good HTML Editor which has FTP just by going to the folder where it is. If you are just protecting one directory, that's where you can put the file. The configurations in the file will affect everything in its directory and the directories under it.

 

Did you save the .htaccess file with NO extensions? If you don't pay attention when saving, the program being use could add an extension like .txt. Then you wind up with just a text file named .htaccess.txt. You have to make sure any FTP program you use is set up properly so it knows.your directory structure or you can see where you can browse to correct folder and drop the file. That's why I suggested you use something like CC's HTML editor. I mirror my entire site on my computer so it matches EXACTLY my directory structure online. That way all edits on page on your computer will be uploaded to the server to the correct directory without you having to worry about it.

 

The CP will get you to any directory/folder or file. Some sites have more than one directory. Ones they use and tell you not to put your site pages in that directory and the root directory you must use for your site to work. If your site is up and running then you have the right root directory.

 

1) I take it the directory path you set up could be accessed with a browser like: https:/ /mysite.com/testpass/imageone.jpg??? Then you can only see the .htacess file by using FTP or the CP's editor. You will not see it normally. If you uploaded the .htaccess file to the testpass directory, it should have been there. If Filezilla was not set up to start from your root folder (where your index.html or landing page is), the file could have been dropped anywhere.

 

2) The .htaccess passwords are kept in a file called .htpasswd. Create and save that file, being sure to store it somewhere other than the web directory, for security reasons. You should use the space inside the .htpasswd file to write in the name and passwords of all the users that you want to have access to the protected part of the site. Should look something like this:

AuthUserFile /usr/local/username/safedirectory/.htpasswd [This line designates the server path to the .htpasswd file.]
AuthGroupFile /dev/null [This line can be used to convey the location of the .htgroup. As we have not created such a file, we can leave /dev/null in place.]
AuthName "Please Enter Password" [This is text that will be displayed at the password prompt. You can put anything here.]
AuthType Basic [This refers to the type of authentication that will be used to the check the passwords.]
Require valid-user [This line represents one of two possibilities. “Require valid-user” tells the .htaccess file that there are several people who should be able to log into the password protected area. The other option is to use the phrase “require user username” to indicate the specific permitted person.]

This is just one example and may not be what you'll use exactly. Might try using this site: htpasswd Generator

 

3. I'm sure I'll not cover a lot that you may need but it should be easy enough since you are password protecting just one folder.

 

I'm sure I forgot something of importance. I'm mainly saying that editing online is easier if: 1) you don't know how to set up a proper directory structure on your computer to mirror the site's 2) to set up the FTP to connect to your server so it knows where the root directory is 3) same for any HTML editor that has FTP.


Edited by AstraNut, 11 February 2020 - 12:54 PM.

  • 0

#15
BerDov

BerDov

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 228 posts

Thank you again!

 

After trying so many times and re-reading your directions and how-to articles, I realize that the whole exercise should take 5 min - assuming one knows what he is doing.

 

Here is what I did:

 

 - created a .htpasswd file containing one line:

            tempuser1:AkFuiXCTUkJ9I

 

where AkFuiXCTUkJ9I is the encrypted "tempword11";

 

 - uploaded file .htpasswd to /admin/ directory via FileZilla, in ASCII mode;

 

- created .htaccess file containing this syntax:

 

AuthType Basic

AuthName "Protected Site"

AuthUserFile /admin/.htpasswd

require valid-user

 

- uploaded .htaccess file to /html/testpass/ directory;

 

- tried to open (in FireFox) the page /mywebsite.com/testpass/testpass_page.html

 

 - - a pop-up login window appeared,

 

however, after entering the username and the password, nothing happened.

I assume the error is the " AuthUserFile /admin/.htpasswd " line but do not know how to fix it (if my assumption is right).

 

When my web site is accessed with FileZilla, this tree is displayed in the "Remote site" pane:

 

/

  [] admin

  [] cgi-bin

  [] data

  [] html

  [] logs

  [] pub

  [] report

 

Waiting for a lifeline.

 

;-)

 


  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP