{"id":49124,"date":"2024-10-14T12:30:00","date_gmt":"2024-10-14T17:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=49124"},"modified":"2024-10-01T06:40:04","modified_gmt":"2024-10-01T11:40:04","slug":"how-to-redirect-urls-using-nginx","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/","title":{"rendered":"How to Redirect URLs Using Nginx"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp\" alt=\"How to redirect URLs using Nginx\" class=\"wp-image-49406\" style=\"width:1010px;height:auto\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-a-domain\/\" target=\"_blank\" rel=\"noreferrer noopener\">URL redirection<\/a>, also called URL forwarding, allows multiple URL addresses to be associated with a single page. This can include a form, the entire website, or a web application. This functionality is executed through a specialized HTTP response called an HTTP redirect. Redirecting URLs involves pointing an existing URL to a new one. This effectively communicates to your visitors and search bots that the URL has a new destination. This redirect can be either a temporary or a permanent redirection. <a href=\"https:\/\/www.rosehosting.com\/nginx-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nginx<\/a>, a web server, has gained more and more popularity over the past few years. It was initially created as a high-performance web server. Using an asynchronous event-driven architecture, Nginx can increase speed and stability when handling high traffic. This article will show you how to redirect URLs using nginx in an easy-to-follow guide.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux VPS hosting<\/a> with Nginx as the web server<\/li>\n\n\n\n<li>SSH root access or a normal system user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Redirection Types<\/h3>\n\n\n\n<p>There are only two redirection types: permanent and temporary. The permanent redirection has HTTP code 301, while the temporary redirection has HTTP code 302. The difference between 301 and 302 redirects lies in how they affect the redirection of URLs on a website. This can have a significant impact on your <a href=\"https:\/\/www.rosehosting.com\/blog\/on-page-vs-off-page-seo\/\" target=\"_blank\" rel=\"noreferrer noopener\">on-page SEO<\/a>. To clarify, below is an explanation of the differences between 301 and 302 redirects in detail:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Permanent Redirect (301)<\/h4>\n\n\n\n<p>As the name indicates, a permanent redirect means the old URL will no longer be used. Visitors will be permanently redirected to the new URL. This means that when visitors access the old URL, they will be automatically redirected to the new URL.<\/p>\n\n\n\n<p>301 redirects also tell search engines that the old URL page has been made permanent and redirected to the new URL. Search engines will pass on any link authority directly from the old URL to the new URL. A 301 redirects are usually used for website pages that have been moved to a new URL or permanently deleted. This is akin to moving your house permanently and letting everyone know your new address.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Temporary Redirect (302)<\/h4>\n\n\n\n<p>Redirect 302 is known as a &#8220;temporary redirect&#8221;. This means the old URL has been moved, and visitors are redirected to the new URL, just like with a 301.<\/p>\n\n\n\n<p>The difference is that a 302 tells search engines that the old URL page is only temporarily redirected to the new URL. This signals to search engines that the old URL will return and will still maintain the page&#8217;s ranking of the old URL. As such, a 302 redirect is typically used for website pages that will return to the original URL after a while. Think of this as leaving your house when you go on an extended vacation and have your mail sent there.<\/p>\n\n\n\n<p>Redirects are helpful when you send website visitors to a different URL according to the page they are trying to access. Here are some popular reasons to use them:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Reroute visitors from discontinued pages (which would otherwise show a <a href=\"https:\/\/www.rosehosting.com\/blog\/how-to-fix-error-404-not-found-on-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">404 error<\/a>) to the most similar page.<\/li>\n\n\n\n<li>Keep old URLs operational after moving from one software system to another.<\/li>\n\n\n\n<li>Take visitors from a short and simple, memorable URL to the correct page.<\/li>\n\n\n\n<li>Redirecting outdated .html URLs or non-www to their www counterparts.<\/li>\n\n\n\n<li>Retain seasonal page content with limited-time deals; the same offer will return next season. Think of Black Friday count-down timer pages.<\/li>\n<\/ul>\n\n\n\n<p>When using Nginx as the web server, you can generally create redirects using rewrite or return directives. Incorporating a redirect map can be beneficial for extensive redirect lists.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Use RETURN Directive<\/h3>\n\n\n\n<p>We can use the return directive in the server context to redirect HTTP to HTTPS or from one domain name to another.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name example.com www.example.com;<br>    return 301 https:\/\/example.com$request_uri;<br>}<\/pre>\n\n\n\n<p>The following configuration should also work if you want to redirect a URL to another.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location = \/blog\/how-to-redirect-in-nginx {<br>     return 301 $scheme:\/\/blog.example.com\/how-to-redirect-in-nginx<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Use REWRITE Directive<\/h3>\n\n\n\n<p>We can place both RETURN and REWRITE directives in the server and location context in the Nginx configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {<br>    listen 80;<br>    server_name example.com www.example.com;<br>    rewrite ^\/(.*)$ https:\/\/example.com\/$1 redirect;<br>}<\/pre>\n\n\n\n<p>We can use the above config to redirect HTTP to HTTPS temporarily. To change it to a permanent redirect, simply replace redirect with permanent.<\/p>\n\n\n\n<p>Another example is to redirect a URL using rewrite, but this time, we use location context.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">location = \/how-to-redirect-in-nginx {<br>     rewrite ^\/how-to-redirect-in-nginx?$ \/redirection-in-nginx.html break;<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Use MAP Directive<\/h3>\n\n\n\n<p>If you have many redirections, you can use Nginx MAP directive. Add the following to the top of your Nginx server block file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">map $request_uri $new_uri {<br>    include \/etc\/nginx\/redirect-map.conf;<br>}<\/pre>\n\n\n\n<p>Then, create a file \/etc\/nginx\/redirect-map.conf, and you can put your old and new URLs there.<\/p>\n\n\n\n<p>The file \/etc\/nginx\/redirect-map.conf should contain something like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/blog\/how-to-redirect-in-nginx \/nginx-redirect;<br>\/old.html \/new.html;<br>\/old-file.php \/new-file.php;<\/pre>\n\n\n\n<p>Make sure to check the map file, it should contain &#8216;;&#8217; at the end of each line or else it causes EOL error. Also, remember that you should restart Nginx every time you modify its configuration file to apply the changes.<\/p>\n\n\n\n<p>That&#8217;s it! You have learned about configuring URL redirects in Nginx.<\/p>\n\n\n\n<p>Of course, you don\u2019t have to spend your time and follow this article to learn how to redirect URLs using Nginx. If you have an active VPS hosting service with us, you can ask our expert Linux admins to redirect URLs using Nginx for you. Simply log in to the client area, then submit a ticket. Our system administrators are available 24\u00d77 and will take care of your request immediately.<\/p>\n\n\n\n<p>If you liked this post on how to redirect URLs using Nginx, please share it with your friends on social media or leave a comment below.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>URL redirection, also called URL forwarding, allows multiple URL addresses to be associated with a single page. This can include &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Redirect URLs Using Nginx\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#more-49124\" aria-label=\"Read more about How to Redirect URLs Using Nginx\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":49406,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1236,1707],"tags":[2153,2149,49,1529,2197,2198,2196],"class_list":["post-49124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","category-web-servers","tag-how-to-2","tag-how-to-guide","tag-nginx","tag-redirect","tag-url","tag-url-redirect","tag-webserver","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Redirect URLs Using Nginx | RoseHosting<\/title>\n<meta name=\"description\" content=\"Learn how to redirect URLs using NGINX using our simple step-by-step guide, or ask our Linux admins to do it for you.\" \/>\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.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Redirect URLs Using Nginx\" \/>\n<meta property=\"og:description\" content=\"How to Redirect URLs Using Nginx | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-14T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Redirect URLs Using Nginx\",\"datePublished\":\"2024-10-14T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/\"},\"wordCount\":889,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/how-to-redirect-urls-using-nginx.webp\",\"keywords\":[\"how to\",\"how to guide\",\"nginx\",\"redirect\",\"URL\",\"url redirect\",\"webserver\"],\"articleSection\":[\"Guides\",\"Web Servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/\",\"name\":\"How to Redirect URLs Using Nginx | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/how-to-redirect-urls-using-nginx.webp\",\"datePublished\":\"2024-10-14T17:30:00+00:00\",\"description\":\"Learn how to redirect URLs using NGINX using our simple step-by-step guide, or ask our Linux admins to do it for you.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/how-to-redirect-urls-using-nginx.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/how-to-redirect-urls-using-nginx.webp\",\"width\":1024,\"height\":576,\"caption\":\"How to redirect URLs using Nginx\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-redirect-urls-using-nginx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Redirect URLs Using Nginx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Redirect URLs Using Nginx | RoseHosting","description":"Learn how to redirect URLs using NGINX using our simple step-by-step guide, or ask our Linux admins to do it for you.","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.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/","og_locale":"en_US","og_type":"article","og_title":"How to Redirect URLs Using Nginx","og_description":"How to Redirect URLs Using Nginx | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2024-10-14T17:30:00+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Redirect URLs Using Nginx","datePublished":"2024-10-14T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/"},"wordCount":889,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp","keywords":["how to","how to guide","nginx","redirect","URL","url redirect","webserver"],"articleSection":["Guides","Web Servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/","name":"How to Redirect URLs Using Nginx | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp","datePublished":"2024-10-14T17:30:00+00:00","description":"Learn how to redirect URLs using NGINX using our simple step-by-step guide, or ask our Linux admins to do it for you.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/10\/how-to-redirect-urls-using-nginx.webp","width":1024,"height":576,"caption":"How to redirect URLs using Nginx"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-redirect-urls-using-nginx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Redirect URLs Using Nginx"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=49124"}],"version-history":[{"count":8,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49124\/revisions"}],"predecessor-version":[{"id":49407,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49124\/revisions\/49407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/49406"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=49124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=49124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=49124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}