redirect a specific url to another url with .htaccess

前端 未结 2 691
庸人自扰
庸人自扰 2021-02-13 05:24

I would like to have an alias and redirect the URL tz433.tld/jobs/ to the page tz433.tld/about-us/jobs/.

This is what I\'ve tried by far; it di

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 05:59

    If you want the rule to only execute when the domain is "tz433.tld", you need this condition:

    RewriteCond %{HTTP_HOST} ^(www\.)?tz433\.tld
    

    And to redirect "jobs/" and "jobs" to "tz433.tld/about-us/jobs.html", you can try one of these:

    RewriteRule ^jobs/? /about-us/jobs.html [R=301,L]
    # or
    RewriteRule ^jobs/? http://tz433.tld/about-us/jobs.html [R=301,L]
    

提交回复
热议问题