Wednesday, September 27, 2023
HomeMobile MarketingConstruct Straightforward Social Media Shortcut URLs to Your Web site with .htaccess

Construct Straightforward Social Media Shortcut URLs to Your Web site 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 website. We’ve even modified our redirect code to append UTM marketing campaign question strings mechanically 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 typically change into obtainable, and you’ll simply replace your deal with. In case you’re distributing your hyperlinks moderately than your deal with, you may all the time replace your redirects for the brand new social media deal with. This implies your print materials, PDFs, and so forth., can merely have your straightforward URL and can by no means require updating if you happen to modify your handles.

htaccess

Nearly all of web sites on-line are constructed on Apache’s internet server, which allows you to 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 numerous configuration modifications per listing. On this case, we will replace our .htaccess file within the root listing of our website 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 may make as many of those as you’d prefer to deal with all your exterior hyperlinks that you just’d prefer to be made into shortcuts. I really assume this can be a much better approach 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 may even compile this info right into a report if you happen to needed to see all the individuals using your distributed straightforward URL, however I haven’t carried out that.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments