Wednesday, September 27, 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 function 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 routinely on any hyperlinks we use like this.

In the event you view our social hyperlinks in our header, you’ll see that these are all inside hyperlinks that redirect with nofollow. The good half about that is that I’ve a simple 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 accessible, and you may simply replace your deal with. In the event you’re distributing your hyperlinks somewhat than your deal with, you’ll be able to 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 simple URL and can by no means require updating when you modify your handles.

htaccess

Nearly all of web sites on-line are constructed on Apache’s net 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 adjustments 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 can also make as many of those as you’d wish to deal with your whole exterior hyperlinks that you just’d wish to be made into shortcuts. I really suppose it is a much better method 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 as a consequence of guidelines outlined within the .htaccess file, Apache usually logs the request and response standing codes, which will help you observe and analyze the redirections.

I suppose you can even compile this data right into a report when you needed to see all the folks using your distributed simple URL, however I haven’t accomplished that.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments