Anchors
Character Classes
POSIX
Assertions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Quantifiers
Add a ? to a quantifier to make it ungreedy. Escape Sequences
“Escaping” is a way of treating characters which have a special meaning in regular expressions literally, rather than as special characters. Common Metacharacters
The escape character is usually \ Special Characters
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Groups and Ranges
Ranges are inclusive. Pattern Modifiers
* PCRE modifier String Replacement
Some regex implementations use \ instead of $. |
Tutorials
Python
- Python Tutorial for Beginners – Learn Python in 5 Hours [FULL COURSE]
How to generate Google Maps API Key
Google requires Maps API Key in order to use google Maps. Follow the step-by-step instructions to create a Google Maps API key:
1. Creating a new project at https://console.developers.google.com/
2. Enable the Google Map APIs by entering “ENABLE APIS AND SERVICES” of the project.
- Search for “Maps JavaScript API”. Then click on it.
- Enable Maps for your website.
NOTE If you are HUB subscriber, you need to enable more Maps Static API.
Google Maps JavaScript API (for Solidres Options – Component – Google Map API Key)
Google Maps Static API (for Solidres Options – Hub – Google Static Map API Key)
3. Create a new API key by creating New Credentials
How to redirect using .htaccess file
- How to exclude a specific folder from rewrite rule in htaccess
- WordPress htaccess
- Default WordPress .htaccess File
- How to Leverage Browser Caching for Images, CSS and JS in .htaccess
- How to remove file extension from a url
- Redirect www to non-www and vice versa
Redirect entire website to any other domain
301 (Permanent) Redirection
Redirect 301 / http://hostbriz.com/
302 (Temporary) Redirection
Redirect 302 / http://hostbriz.com/
Redirect file to a specific file/domain/directory/folder
Redirect file to domain
Redirect /index.html https://healthproclub.com/
Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
Redirect /old to /new directory
RewriteRule ^old/(.*)$ /new/$1 [R=301,NC,L]
Set the default index extension
DirectoryIndex index.html
Set redirect except condition RewriteCond
Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/index.php RewriteCond %{REQUEST_URI} !^/fss RewriteRule (.*) https://journals.healthproclub.com/$1 [R=301,L]
Redirect 404 Error pages to homepage
ErrorDocument 404 https://bdhostit.com/
Redirect non-existing page(s) to index.php
Options +SymLinksIfOwnerMatch RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
Redirect everything to https://hostbriz.com
RewriteEngine on RewriteRule ^(.*)$ https://hostbriz.com/$1 [R=301,L]
Redirect a directory to
RewriteRule ^journal/(.*)$ https://hostbriz.com/$1 [R=301,NC,L]
Redirect all sub domains to main domain with www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect all sub domains to main domain without www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Redirect www, non-www, http to https without www
RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC] RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
Website is undergoing some maintenance and will be back soon.
Please note that our website is undergoing some technical maintenance. We’ll be back soon.
We thank you for your patience and hope to see you soon!
<html> <head> </head> <body cz-shortcut-listen="true"> <div style="position:absolute;left:0;right:0;top:20%;bottom:0;height: 100vh;text-align: center;"> <h1>Website is undergoing some maintenance and will be back soon.</h1> Please note that our website is undergoing some technical maintenance. We’ll be back soon. We thank you for your patience and hope to see you soon! </div> </body> </html>