{"id":74,"date":"2020-02-12T10:36:24","date_gmt":"2020-02-12T10:36:24","guid":{"rendered":"https:\/\/www.lcn.com\/support\/knowledge-base\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/"},"modified":"2020-03-04T16:15:59","modified_gmt":"2020-03-04T16:15:59","slug":"how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess","status":"publish","type":"ht_kb","link":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/","title":{"rendered":"How to shorten a web address using .htaccess"},"content":{"rendered":"<p>Redirecting web addresses is a common use for .htaccess when addresses become too long or complicated. For example, if you had a blog running on your website and you wanted to share a post you had made the address could look something like:<\/p>\n<pre class=\"prettyprint linenums\">http:\/\/www.mydomain.com\/how-to-use-htaccess-to-redirect-long-urls\/<\/pre>\n<p><\/br>Using .htaccess we could create a redirect that is easier to type and remember e.g.<\/p>\n<pre class=\"prettyprint linenums\">http:\/\/www.mydomain.com\/htaccess<\/pre>\n<p><\/br>This technique is often referred to as url rewriting. Here is what our .htaccess file would look like:<\/p>\n<pre class=\"prettyprint linenums\">&lt;IfModule mod_rewrite.c&gt;  \nRewriteEngine On  \nRewriteRule ^\/htaccess$ \/how-to-use-htaccess-to-redirect-long-urls [L]\n&lt;\/IfModule&gt;<\/pre>\n<p><\/br><strong>Lines 1 and 4<\/strong> &#8211; Wrap our rewrite rule in a container that checks rewriting is available.<\/p>\n<p><strong>Lines 2<\/strong> &#8211; Turns rewriting on.<\/p>\n<p><strong>Lines 3<\/strong> &#8211; The rule says if there is a request for &#8216;www.mydomain.com\/htaccess&#8217; rewrite (redirect) it to &#8216;www.mydomain.com\/how-to-use-htaccess-to-redirect-long-urls&#8217;. Finally the <strong>[L]<\/strong> means don&#8217;t process any more rules.<\/p>\n<p>Once you have created your .htaccess file you just need to upload it to the web folder for your hosting <a href=\"\/support\/articles\/how-to-upload-files-to-your-website-with-ftp\" target=\"\" rel=\"noopener noreferrer\">using FTP<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redirecting web addresses is a common use for .htaccess when addresses become too long or complicated. For example, if you had a blog running on your website and you wanted to share a post you had made the address could look something like: http:\/\/www.mydomain.com\/how-to-use-htaccess-to-redirect-long-urls\/ Using .htaccess we could create a redirect that is easier to [&hellip;]<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[15],"ht-kb-tag":[5],"class_list":["post-74","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-creating-a-new-website","ht_kb_tag-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to shorten a web address using .htaccess - LCN.com<\/title>\n<meta name=\"description\" content=\"How to create short URL&#039;s with .htaccess.Follow this simple guide to create shorter, more memorable URL&#039;s for your website using .htaccess.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to shorten a web address using .htaccess - LCN.com\" \/>\n<meta property=\"og:description\" content=\"How to create short URL&#039;s with .htaccess.Follow this simple guide to create shorter, more memorable URL&#039;s for your website using .htaccess.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Customer Support Guides - LCN\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/lcndotcom\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-04T16:15:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@lcndotcom\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/\",\"url\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/\",\"name\":\"How to shorten a web address using .htaccess - LCN.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#website\"},\"datePublished\":\"2020-02-12T10:36:24+00:00\",\"dateModified\":\"2020-03-04T16:15:59+00:00\",\"description\":\"How to create short URL's with .htaccess.Follow this simple guide to create shorter, more memorable URL's for your website using .htaccess.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.lcn.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to shorten a web address using .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.lcn.com\/support\/#website\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"name\":\"Customer Support Guides - LCN\",\"description\":\"- LCN\",\"publisher\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.lcn.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\",\"name\":\"LCN.com\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"contentUrl\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"width\":461,\"height\":461,\"caption\":\"LCN.com\"},\"image\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/lcndotcom\",\"https:\/\/x.com\/lcndotcom\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to shorten a web address using .htaccess - LCN.com","description":"How to create short URL's with .htaccess.Follow this simple guide to create shorter, more memorable URL's for your website using .htaccess.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to shorten a web address using .htaccess - LCN.com","og_description":"How to create short URL's with .htaccess.Follow this simple guide to create shorter, more memorable URL's for your website using .htaccess.","og_url":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/","og_site_name":"Customer Support Guides - LCN","article_publisher":"https:\/\/www.facebook.com\/lcndotcom","article_modified_time":"2020-03-04T16:15:59+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@lcndotcom","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/","url":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/","name":"How to shorten a web address using .htaccess - LCN.com","isPartOf":{"@id":"https:\/\/www.lcn.com\/support\/#website"},"datePublished":"2020-02-12T10:36:24+00:00","dateModified":"2020-03-04T16:15:59+00:00","description":"How to create short URL's with .htaccess.Follow this simple guide to create shorter, more memorable URL's for your website using .htaccess.","breadcrumb":{"@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-a-long-web-address-into-a-more-memorable-one-with-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lcn.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to shorten a web address using .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.lcn.com\/support\/#website","url":"https:\/\/www.lcn.com\/support\/","name":"Customer Support Guides - LCN","description":"- LCN","publisher":{"@id":"https:\/\/www.lcn.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lcn.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.lcn.com\/support\/#organization","name":"LCN.com","url":"https:\/\/www.lcn.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","contentUrl":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","width":461,"height":461,"caption":"LCN.com"},"image":{"@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/lcndotcom","https:\/\/x.com\/lcndotcom"]}]}},"_links":{"self":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":1,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/74\/revisions"}],"predecessor-version":[{"id":411,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/74\/revisions\/411"}],"wp:attachment":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-category?post=74"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-tag?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}