开发者

error handling and search engines

开发者 https://www.devze.com 2023-04-10 11:21 出处:网络
I have just changed my page structure from eg /my_page.php to /my_page/ but now all cached pages on search engines gives 404..

I have just changed my page structure from

eg

/my_page.php

to

/my_page/

but now all cached pages on search engines gives 404..

how can I handle them? is it possible to redirect all 404 to directly to the domain www.domain.com and in the same tiem send back a 301 redirect to the search eng开发者_StackOverflowine?


Try the following in htaccess (if available) or the virtual host's config:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*\.php$ /$1/[R=301,L]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号