Just finished reading the latest stackoverflow blog post about moving static content to a separate domain.
https://blog.stackoverflow.com/2009/08/a-few-speed-improvements/
However my website makes extensive use of Themes for rebranding for our customers. Is there a way of moving this data to a static domain?
Without any more information i dont see why not. Basicly you can offload all static content like pictures,css or any other files that not generated to a seperate domain.
If your wondering about spesfic files please provide details.
Related
I have launched a WordPress site for a private group of people. This site serves as a public representational site, but also they make "posts" with "Private" checked, so only logged in users can see those posts. Everything would be OK, but they also upload image/document files and attach/include them to private or public posts. All is OK with public posts, but when the file is used in a private post, we assume the file is confidential. But here WordPress allows accessing any uploaded file directly via a link (URL), even if you're not logged in to the site from the browser.
I tried searching but can't find something that would actually work. Even FB private groups have this file access restriction for outsiders, GitLab also has permissions, where if you are not in a project, you can't access ANYTHING that's there. It seems like if I used WordPress/Joomla/Drupal, it would be hacking/messing around to achieve what I want.
Do you have any suggestions, maybe to access uploaded files through WordPress (PHP) and not directly via web server, so via PHP I could make some SQL queries and check in what posts that file is included and whether the user is logged in? Also maybe there are some plugins that do exactly that?
P.S. I wouldn't be asking if I knew WordPress in-and-out, but in this case, I just launched it more or less.
One option to fix this problem is to store the file contents in the database as a blob. This could be problematic if the files are large, however, as you predicted: you can ensure that the recipient is authorised before delivering the content. Another option might be to move the file when the post is saved so that it can't be accessed directly at the http endpoint.
In either of these cases, you might then use .htaccess to redirect any GET requests for files within that directory to a new php file that delivers the content. You can check to see if the user is logged in before delivery using standard WordPress function, and/ or pull the content out of the database on the fly. These options require custom code to achieve.
(Is the file being checked for malign content, and the filename being changed to something non-deterministic, by the way? This is a vector for attack.)
If you don't wish to code, you might consider a parallel installation of ownCloud or NextCloud and then in the private post, your users place a link to the file within the other service. Both of these applications provide a number of different clients for various devices, as well as the ability to restrict access to specific groups and users.
We plan to move our static websites from dedicated servers running nginx to Netlify / Github Pages.
Currently we run nginx as our web server. Nginx allows our content to be organised in flat hierarchy as shown below and let us map each URL to the file system path like. For example,
/web/main -> for https://example.com/
/web/docs -> for https://example.com/docs/
/web/jsapp -> for https://example.com/app/
As I understand from the Netlify / Github Pages documentation, we may need to reorganize our content in deep hierarchy like following (please correct me here):
/web/main
/web/main/docs
/web/main/jsapps
Is this a correct understanding? if yes, we would like to avoid that. I hope that Netlify / Github Pages will have something to organize the url and content path individually like nginx does but I couldn't find anything other than redirect (which is not what I am looking for).
Any idea?
Thanks
Yes. Correct. Most of it will come down to reorganizing your static website in a specific structure. You will have to make sure you have an index.html at the root. If you plan on using something like Jekyll or Hugo or even Gatsby, that could help with pipelining assets, building URLS, etc. but moving a compiled static site will need to follow a specific structure. In the end, github pages hosts that and not the engine.
If you leave anything on the nginx too, say css, then you will need server side push too. A lot of variables there. Small ones however. Restructuring is anyway the better way to do it, if it is all static content.
I have to migrate a website that no longer using its Media library but cloudfront, I wonder the process to migrate it will be any different?
Normally I use WP plugin Duplicator, All in one migration, or just copy files & database (change domain name) directly to the new server.
I wonder will it work the same for cdn content website or I have to do something else?
At the first day, I may use a temporary domain name and testing if it's ok we will redirect the live domain name to it.
Please give me advice if you have experienced this.
Thank you very much.
I have an old WordPress blog that I no longer use but want to keep the pages to support old incoming links. Right now I pay $20/mo for a t1.micro instance on EC2 just to run the stupid thing. I decided to use the Really Static plugin to extract the entire site in to static content with the goal to host it on S3's ability to host root domain content.
The good news is that the static export worked great. The bad news is that my URLs never used "clean URLs" and so the pages were stuff like http://example.com/blog/?p=123. The way the plugin works is that it exports a directory such as p=123 and then puts an index.html file in it.
My question is: does anyone have a bright idea on how (or if) I can host a URL like /blog/?p=123 and serve it from S3 using the static content I have? Even when I create a directory in S3 of ?p=123 I can only get /blog/%3Fp%3D123/index.html to serve while /blog/?p=123/index.html shows an access denied error.
Thanks!
http://www.slowping.com/index.html%3Fp=76.html discusses converting a wordpress blog to s3.
As you can see from the url, he's using the p= style of url. He seems to be using the directions from http://mossiso.com/2007/09/10/converting-wordpress-to-static-html.html though, so it may be that you just need to use a different converter.
Followup: Here's an article that discusses converting a custom themed wordpress install to octopress and it discusses some edge cases that may be relevant.
http://mrdanadams.com/2012/migrating-wordpress-custom-theme-octopress-jekyll/#.UUJxNltxuGo
I want to create a static website and use wordpress only to "compose" the website. I want to create a template that only use the same header and footer and change the content of the page (home, contact ecc dcc). My site is not a blog or any other type of site that needs CMS I only want to use Wordpress to have only one header and footer and don' t want to change it in all pages when I need some customization to it. I hope I was clear enough! Thanks!
You can create a site in WordPress (or any other CMS) on your own local computer, then save a copy using an offline browser such as HTTrack. Then upload the HTTrack saved HTML to your webhost.
This will make your site faster, as there will be no need to execute PHP on page requests, and the webserver will use its default caching headers. (Also, you get the option of using a cheaper hosting without support for PHP and MySQL.)
Any time you change the site, you'll need to edit the live WordPress version, save it again, and reupload the files.
Disclaimer: I'm dev of the WP Static HTML Output project.
It's been around for a few years and still has 5k+ active installs, but jazzing it up with some more features now and its whole purpose is to allow you to use WordPress for your site development and export to a static HTML version for speed, security and portability.
For the OP, the basic FTP publishing option may be of use. For more advanced cases, there are services like Netlify which can auto build/deploy your static site from a Git branch.
In the Settings | Reading admin page, choose a static page for your front page display. Build your site out using Pages instead of Posts. Each Page will inherit your site's standard header and footer. Create your Main Menu from the Appearance | Menu admin page to hook together your Pages. Use widgets and standard HTML links as needed. Then dress up your site with one of the many available themes.
A bit late to the table on this one but it seems that Wordpress is totally overkill for a static site. Wordpress pages can be cached with cache plugins but when any Wordpress site loads there are a number of scripts and custom php functions that run each time a page loads.
Why not just build a flat file website and simply include your header and footer with PHP? Far quicker to set up and based on your question it seems that this is simply what you need.
Added to this, you won't have an admin area for your site or a database, just the files on the server - surely this makes your site less hackable too. An added bonus is a really easy site to version control with Git or SVN.
If there's someone else out there wanting to use a static site generator over Wordpress, here's a script called WP Static which does just this: http://mossiso.com/code/make-wordpress-static
Another great solution to this problem is to use a specific software that is created exactly to do that. For Mac, for example, there's a software called Hammer that "compile" your site every time you save and includes your header and footer to the page. Is really useful.