.htaccess - Permanent 301 Redirect in Godaddy Plesk Server (old url to new url) -
to stop canonical issue in website, want redirect
http://www.example.com/index.html
to
http://www.example.com
and there used old files have deleted server google haven't removed them it's index, want redirect them well. non-existing file url new existing file url. like
http://www.example.com/index2.html
to
http://www.example.com
i have tried below code in newly created web.config file after adding site stops working giving 500 server error.
<configuration> <location path="index2.html"> <!-- file not exist in server anymore --> <system.webserver> <httpredirect enabled="true" destination="http://www.example.com" httpresponsestatus="permanent" /> </system.webserver> </location> <location path="index.html"> <system.webserver> <httpredirect enabled="true" destination="http://www.example.com" httpresponsestatus="permanent" /> </system.webserver> </location> <location path="old_url.html"> <system.webserver> <httpredirect enabled="true" destination="http://www.example.com/new_url.html" httpresponsestatus="permanent" /> </system.webserver> </location> </configuration>
i have tried adding .htaccess file after deleting web.config file
redirect 301 /index2.html / redirect 301 /index.html / redirect 301 /old_url.html /new_url.html
and it's not working well.
Comments
Post a Comment