{"id":1256,"date":"2012-05-23T18:40:36","date_gmt":"2012-05-23T16:40:36","guid":{"rendered":"http:\/\/www.hyperpac.de\/?p=1256"},"modified":"2012-05-23T18:52:23","modified_gmt":"2012-05-23T16:52:23","slug":"howto-redirect-or-forward-a-link-url-via-htaccess","status":"publish","type":"post","link":"https:\/\/www.hyperpac.de\/?p=1256","title":{"rendered":"Howto redirect or forward a link \/ url via .htaccess"},"content":{"rendered":"<p>If you want to redirect \/ forward a link \/ url the easiest solution is to use a .htaccess file. You need to place it in the directory where the user would normally land with the original link.<\/p>\n<p>The general structure is simple. You\u00b4ll only need to enter one single line in the .htaccess file:<\/p>\n<blockquote><p>Redirect permanent <span style=\"color: #ff0000;\">old location<\/span> <span style=\"color: #008000;\">new location<\/span><\/p><\/blockquote>\n<ul>\n<li><span style=\"color: #ff0000;\">old location<\/span> must be a relative link to root of your server structure, e.g. \/wwwroot\/index.html<\/li>\n<li><span style=\"color: #008000;\">new location<\/span> must be a full link, e.g.\u00a0 http:\/\/www.yoursite.de\/index.html<\/li>\n<\/ul>\n<p>So in case you want to redirect <em>http:\/\/www.mysite.com\/index.html<\/em> to <em>http:\/\/www.my-new-site.com\/index.html<\/em> your .htaccess file needs to be placed in the same directory where the index.html is and should look like this:<\/p>\n<blockquote><p>Redirect permanent <span style=\"color: #ff0000;\">\/wwwroot\/index.html <\/span><span style=\"color: #008000;\">http:\/\/www.my-new-site.com\/index.html<\/span><\/p><\/blockquote>\n<p>If you want to redirect something like this <em>http:\/\/www.mysite.com\/uploads\/12\/myuploadedfile.rar<\/em> to this new location <em>http:\/\/www.my-new-site.com\/download\/myuploadedfile.rar<\/em> then your .htaccess file needs to be placed in the &#8220;12&#8221; directory and should look like this:<\/p>\n<blockquote><p>Redirect permanent <span style=\"color: #ff0000;\">\/wwwroot\/uploads\/12\/myuploadedfile.rar<\/span><span style=\"color: #008000;\"> http:\/\/www.my-new-site.com\/download\/myuploadedfile.rar<\/span><\/p><\/blockquote>\n<p>Remember: The <em>\/wwwroot\/<\/em> can be different on your site \/ server. You need to find out the webservers document root. A common directory is also <em>\/public_html\/<\/em>.<\/p>\n<p>&#8212;<\/p>\n<p>Thx to the <a href=\"http:\/\/www-stud.informatik.uni-frankfurt.de\/~www1test\/redirect.html\" target=\"_blank\">RBI @ Uni Frankfurt<\/a> &#8211; see their <a href=\"http:\/\/www-stud.informatik.uni-frankfurt.de\/~www1test\/redirect.html\" target=\"_blank\">site for more information about url redirecting <\/a>(only in german).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to redirect \/ forward a link \/ url the easiest solution is to use a .htaccess file. You need to place it in the directory where the user would normally land with the original link. The general structure is simple. You\u00b4ll only need to enter one single line in the .htaccess file: &hellip; <a href=\"https:\/\/www.hyperpac.de\/?p=1256\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Howto redirect or forward a link \/ url via .htaccess<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[580,488,604,607,608,602,605,606,603,601,609],"class_list":["post-1256","post","type-post","status-publish","format-standard","hentry","category-it_wordpres","tag-htaccess","tag-apache","tag-forward","tag-http","tag-https","tag-link","tag-mod_rewrite","tag-permanent","tag-redirect","tag-url","tag-webserver"],"_links":{"self":[{"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/posts\/1256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1256"}],"version-history":[{"count":5,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/posts\/1256\/revisions"}],"predecessor-version":[{"id":1261,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=\/wp\/v2\/posts\/1256\/revisions\/1261"}],"wp:attachment":[{"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hyperpac.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}