Tuesday, November 21, 2023
HomeMobile MarketingConstruct Straightforward Social Media Shortcut URLs to Your Website with .htaccess

Construct Straightforward Social Media Shortcut URLs to Your Website with .htaccess


Since Martech Zone is constructed on WordPress, we make the most of the redirections characteristic in Rank Math to handle all of our referring URLs for our web site. We’ve even modified our redirect code to append UTM marketing campaign question strings robotically on any hyperlinks we use like this.

In case you view our social hyperlinks in our header, you’ll see that these are all inner hyperlinks that redirect with nofollow. The good half about that is that I’ve a straightforward hyperlink to distribute for any of our social media websites. Instance: YouTube is https://martech.zone/refer/youtube/

The benefit of that is fairly easy. Social media handles generally turn into out there, and you may simply replace your deal with. In case you’re distributing your hyperlinks relatively than your deal with, you possibly can all the time replace your redirects for the brand new social media deal with. This implies your print materials, PDFs, and so on., can merely have your straightforward URL and can by no means require updating in the event you modify your handles.

htaccess

The vast majority of web sites on-line are constructed on Apache’s net server, which lets you construct redirects utilizing htaccess. It’s a plain textual content configuration file that’s each highly effective and versatile, enabling web site directors to make varied configuration adjustments per listing. On this case, we will replace our .htaccess file within the root listing of our web site to simply redirect guests to exterior websites.

Redirect 301 /linkedin https://www.linkedin.com/firm/martechzone/
Redirect 301 /fb https://fb.com/marketingtechnology
Redirect 301 /twitter https://twitter.com/martech_zone
Redirect 301 /youtube https://www.youtube.com/@MartechZone
Redirect 301 /rss https://feed.martech.zone/
Redirect 301 /podcast https://interviews.martech.zone/

You can also make as many of those as you’d prefer to deal with your entire exterior hyperlinks that you simply’d prefer to be made into shortcuts. I really assume it is a much better technique to create these than distributing shortened URLs.

Apache does log details about requests and responses, together with those who contain .htaccess redirects. When a redirection happens resulting from guidelines outlined within the .htaccess file, Apache usually logs the request and response standing codes, which may also help you observe and analyze the redirections.

I suppose you possibly can even compile this info right into a report in the event you wished to see all the folks using your distributed straightforward URL, however I haven’t accomplished that.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments