سؤال

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