Posts

Showing posts with the label Web

.htaccess cook book, examples, and favourites

Image
All of My Favourite .HTAccess Examples Wildcard Domain Example #1 This will take your URL request, for anything.dummysite.com and redirect to dummysite.com/anything/index.html.  Combined with an CNAME Record for @ #### URL Rewrite Handler for Subdomains (by Randall Krause) #### RewriteCond %{HTTP_HOST} !^www\.dummysite\.com$ RewriteCond %{HTTP_HOST} ^(\w+)\.dummysite\.com$ RewriteCond %{REQUEST_URI}:%1 !^/([^/]+)/([^:]*):\1 RewriteRule ^(.*)$ /%1/$1 [QSA] Wildcard Domain Example #2 What this does is if user visits: test.example.com, it will show contents of file: example.com/user/profile.php?name=test. If someone goes to lol.example.com, it will show page: example.com/user/profile.php?name=lol but the URL will remain the same with the subdomain, like test.example.com and lol.example.com. RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC] RewriteRule ^/?$ /user/profile.php?name=%1 [L] Single Argument Example ## example:  http://dumm...

Useful Web Development Hacks and Useful Tips

Javascript, HTML and PHP Tips and Shortcuts Change the URL in the browser address bar.  A useful hack to so that when you have an <A HREF="#" > and an OnClick handler, your browser addressbar will get cleaned up. Changing only what's after hash - old browsers document . location . hash = 'lookAtMeNow' ; Changing full URL. Chrome, Firefox, IE10+ history . pushState ( 'data to be passed' , 'Title of the page' , '/test' ); The above will add a new entry to the history so you can press Back button to go to the previous state. To change the URL in place without adding a new entry to history use history . replaceState ( 'data to be passed' , 'Title of the page' , '/test' ); Make and Install a Favicon using this favicon generator:   https://www.favicon-generator.org/   upload your favicon image and then download prepared set of images and some html code.

Install SSL Certificate on Amazon Bitnami Wordpress Website

Image
How to Get A Free SSL Certificate and How to Install It SSL Certificates Should Be Free For Everyone Let's Encrypt and SSL For Free are two of the most famous free SSL services out there, with your new Amazon EC2 Bitnami Wordpress virtual machine, you now need an SSL Certificate. Get your free certificate at SSL4Free.com , install it like a boss the hardway using the SSH command line.  In our knowledge base story regarding 31 Tips for Your First Business Website , our advice is to install an SSL Certificate immediately.  Amazon EC2 Bitnami Wordpress is another great way to get a free website, free of hosting charges. We have a list of free hosting options here . You must run it on the free tier. Breaking News for June 2020 SSL For Free is retired and now obsolete.  It has been bought out by comodo. You can only get 3 free certs now.  My recommendation is to use Certbot to automate your certificate renewals thru lets' encrypt. Here's a great how to guide for Amaz...