문제

The standard redirect 301 template for htaccess is usually:

redirect 301 /folder_wrong/name.html http://website.com/folder-right/name.html

With the http website included

I'm wondering if the below would work WITHOUT the http website and only having the directory, because all I'm doing is transferring from one directory to another:

redirect 301 /folder_wrong/name.html /folder-right/name.html

That is fine right?

도움이 되었습니까?

해결책

No, you have to use the full URL. See http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect.

As pointed out by Stijn in the comment below, you can specify the URL paths also starting from version 2.2.6.

You can use mod_rewrite if you need to overwrite only fragments of the URL.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top