Allow Logged In Wordpress users to read a folder of HTML pages - html

I have a WordPress site installed in the root folder. Beneath the root is a /docs folder with a bunch of older HTML files. I'd like to allow only logged in WordPress users to be able to have access to those /docs HTML pages (not to be confused with WordPress 'pages').
I created a WordPress 'portal' page which displays links to the /docs pages if the visitor is logged in. I would also like to put in a textual search function (which I know how to do) so logged in visitors can get a list of relevant /docs HTML pages
What I -don't- know how to do is prevent -not- logged in visitors from direct access to the /docs pages for both links and searches?
I know I could do these if I converted the HTML pages to PHP and checked an referrer. But I don't want to have to redo all the old HTML if possible (if I have to do -that- I'll just import them into a WordPress taxonomy---but I hope to avoid that!)
I looked at .htaccess and I was hoping to perhaps set an ENV variable or use REFERRER, but I keep reading that such things are not reliable.
Ideas?

Related

Redirect Hardcoded URLs .htaccess

I have a very old website and it's written in plain HTML. The website used to be hosted publicly, however I downloaded an archive and I now only need it on my localhost (XAMPP) environment.
I had a look at the website code and every link is hardcoded and begins with http://example.com. The site contains thousands of links e.g.;
http://example.com/category/
http://example.com/category/item
http://example.com/category/item/details/item123.html
etc
What's the most efficient way for me to replace all of the links beginning with http://example.com/ with localhost
I could use find and replace but should I instead use a .htaccess?
I should add that the domain http://example.com no longer exists and I have no access the the hosting etc.
So for example if I click a link that's hardcoded to http://example.com/category/item/details/item123.html it should go to http://localhost/category/item/details/item123.html

Is it possible to configure IIS to always redirect to html inside folder based on folder name?

I'm very new to IIS, so I'm not sure what I'm trying to ask. I have for each day about 5-10 static html pages contained in a folder, and the folder names are just the date, and I'd like for users to be directed to the most recent folder whenever they enter the main url. Any of the html pages inside the folder will do.
For example, if the url is "mysite.com", I'd like "mysite.come" to send them to "mysite.com/2015-01-02/main.html" for today, and tomorrow after I build the html pages for them to be sent to "mysite.com/2015-01-03/main.html".
Does that make sense? Is that possible? Thanks!

how to load HTML pages, from a location different from root, on the same server?

I am making my first web site with OSX; this is an internal website for my company.
When the server start, I load pages from a different location, from the one that OSX server used to create my template site (because I do redirects that go on the same IP address, so the pages of the redirect obscure the ones from OSX server). These pages are served by a product called Buildbot (a CI server).
Now, I load the main page from the python directory on my computer, and I would like to avoid to get all the pages for the server there, to not mix them up with the buildbot pages; so I am trying to use the directory that OSX server created for me.
The issue thou, is that I do not know how to link pages...HTML is something that I forgot with time; but I remember that each site starts from a root directory, so the computer is protected by outsiders that may try to force it.
Now, I assume that my root is where the start page is loaded from (in my case is /Library/Python/2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/web/templates/), so if I use an href to link to another page, I can just access to this tree.
Which means that my website should be in a folder in this path? I can't seem to access the site where OSX server created the website resource (which in my case is Library/Server/Web/Data/Sites/mySite/).
Has been so long since when I used HTML, so I am quite rusty on the topic, and would appreciate a lot any kind of hint. The site will not be available outside our internal network, so I simply need to link pages and resources scattered on my server HD, and put them on web pages.
Here's how I understand:
Let's say your web root is /root, but you want to have a href to an html file in /dog, for example. Is this correct?
Assuming so, you cannot link an HTML file that is not in the web root, as the browser needs to be able to access it. If you were using a server-side programming language you could do this, but not with HTML.

Drupal: The easiest way to create HTML page without usage of drupal

How can I make Drupal "print" the .html file which is stored inside Drupal directory (e.g. in drupal root directory, or in sites/all/files/)?
I want to get that .html file by simple path like http://www.mydomain.com/thatfile.html, without theming, etc.
P.S. to explain the motivation: I want users to be able to print the location map from the site (pressing "Print map" link). I could do it not redirecting the user to new tab (I want them to be redirected to new tab :)). But what if user will accidentally press "Cancel"? (User can become confused)
Thanks in advance.
If Drupal is hosted on http://example.com/, and there is a file named results.html, visiting http://example.com/results.html you will get the content of that HTML file.
One of the rewrite rules included in the .htaccess file Drupal comes with says to the web server to serve a file that exists.

Custom home page with iWeb

How can I create a custom 'skin-style' homepage for a website published in iWeb?
The current root URL mydomain.com redirects to mydomain.com/myiWebsite/welcome.html. I want to create a new homepage at the root URL, which has links to the other published pages on the site. I guess this will mean telling iWeb to stop redirecting from the root?
Do you have access to the actual publishing directory on the server? is the server your computer or do you actually host these files somewhere else? Does iWeb just upload the files you create in iWeb to the server you specify?
Most likely, iWeb has created an index.html file at mydomain.com that has an auto-redirect header in it. It is either that, or there is a server-level (.htaccess) config file that is telling all requests to mydomain.com to go to the welcome page.
In either situation, telling the server/html page to do something else probably won't fix the problem if you continue to use iWeb as your method of publishing to the server, since iWeb expects your pages to behave the way iWeb sets them up to behave. Changing one thing could very easily break all of the other parts of your pages iWeb has created.
I hate to be the guy that says "You should just do it all from scratch and be hardcore" but unless iWeb has a preference for making the change within iWeb, you probably have to choose between iWeb and how it does things or something else entirely.