.htaccess Redirect Doesn't Work / Hosting Redirects Automatically to a Defined Page
I'm making a SEO work for a website that designed by someone else and I had to change url's of some pages. But they have old url's in google searchs still. So I want to redirect them to new pages in my .htaccess.
But no matter what I do, I get the error:
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
I tried
RedirectMatch 301 ^/contact\.php$ /contact-us.php
RedirectPermanent /contact.php /contact-us.php
ErrorDocument 404 /error.html
I also tried to create the old page just to see if it doesn't redirect because of it's unexistence.
The hosting company has a CPanel(Parallels Plesk Panel 9), I guess it's what causes this, but "Custom Error Documents" section is tu开发者_运维技巧rned off. I turned it on, there's an "error_docs" folder, it redirects to "not_found.html". And I can't change those pages or delete because "I don't have permissions".
This is the URL. My current .htaccess file is:
RewriteRule ^([^\.]+)$ $1.html [NC,L]
RedirectPermanent /default.htm /index.htm
Try this:
Options +FollowSymLinks -MultiViews
DirectoryIndex index.htm
ErrorDocument 404 /error.html
RewriteEngine On
RewriteBase /
RewriteRule ^contact\.php$ /contact-us.php [NC,L]
RewriteRule ^default\.htm$ /index.htm [NC,L]
RewriteRule ^([^\.]+)$ $1.html [L]
If still nothing -- then contact your hosting company -- they should know for sure.
精彩评论