Here’s the metadata URLs for both AWS and GCP.
curl http://169.254.169.254/computeMetadata/v1/ -H "Metadata-Flavor: Google" curl http://169.254.169.254/latest/meta-data/ |
cloud engineer
Here’s the metadata URLs for both AWS and GCP.
curl http://169.254.169.254/computeMetadata/v1/ -H "Metadata-Flavor: Google" curl http://169.254.169.254/latest/meta-data/ |
curl http://169.254.169.254/computeMetadata/v1/ -H "Metadata-Flavor: Google" curl http://169.254.169.254/latest/meta-data/
There are multiple ways to change URL in WordPress.
Here’s one via wp-config.php.
define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' ); |
define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' );
If you have a redirect in Apache, comment it out.
#Redirect permanent / https://yourdomain.com/ |
#Redirect permanent / https://yourdomain.com/
This is by far the easiest way to change URL in WordPress.
Here’s how to login to GCP from Google SDK.
gcloud auth login |
gcloud auth login
You will then be taken to a page that you have successfully logged in.
If you need to special characters encoded in a URL, these sites really come handy. Why is there a need to encode? URLs accepts only alphanumeric characters and a limited number of special characters. For example, : and / are common characters you’ll find in URLs. Meanwhile spaces are not allowed, but instead are represented as %20 when encoded. There are other special characters that will need to be encoded.
Here are a couple of sites to help you encode:
https://www.urlencoder.org/
https://www.url-encode-decode.com/
The Genesis theme is a WordPress theme from StudioPress. I recently worked on a project where there was a need to redirect the URL title to another URL. Essentially, there are two separate WordPress installs on the server, one install had WordPress on the root directory, the other on a sub-directory. The URL title of the WordPress on a sub-directory needed to point to the root directory. So, here’s the fix that you need to add in the functions.php for Genesis themes.
//* Modify the header URL - HTML5 Version add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 ); function child_header_title( $title, $inside, $wrap ) { $inside = sprintf( '<a href="http://example.com/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside ); } |
//* Modify the header URL - HTML5 Version add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 ); function child_header_title( $title, $inside, $wrap ) { $inside = sprintf( '<a href="http://example.com/" title="%s">%s</a>', esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); return sprintf( '<%1$s class="site-title">%2$s</%1$s>', $wrap, $inside ); }
Just add this piece of code to the functions.php file of your Genesis child theme.
I ran into some issues with a piece of code I wrote several years ago in CodeIgniter. I’m using names of people as part of the URL. When someone enters a name with spaces on the database, the spaces are converted to %20 in the resulting URL. The URL doesn’t look pretty and definitely not SEO friendly. It needs to be cleaned up by replacing spaces with either a dash or an underscore.
The other issue is when performing a search, the database doesn’t really know that ‘John Doe’ is essentially the same as ‘John%20Doe.’ So, I ended up using a CodeIgniter function called url_title. The function strips the spaces and replaces it with a dash or a hyphen. In the case of ‘John%20Doe’, it now displays as ‘John-Doe.’ You can also use an underscore. See example below.
$name = 'John Doe'; $url = url_title($name); // produces 'John-Doe' $name = 'John Doe'; $url = url_title($name, '_'); // produces 'John_Doe' |
$name = 'John Doe'; $url = url_title($name); // produces 'John-Doe' $name = 'John Doe'; $url = url_title($name, '_'); // produces 'John_Doe'
Before performing a search, I use str_replace to remove the dash and put back the space so it matches the database entry. It’s essentially the reverse of what I did to display a friendly URL.
$url = 'John-Doe'; $name = str_replace('-', ' ', $url); // perform your search function here |
$url = 'John-Doe'; $name = str_replace('-', ' ', $url); // perform your search function here
If you’re not familiar with CodeIgniter, check how URI routing and url_title are handled.