Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
好吧,现在我解决了加载页面的问题。我会更好地解释自己......
我想做的就是那些重定向:
http://www.domain.com/ - > http://domain.com/
http://domain.com - > http://domain.com/
http://domain.com/article/55/any-name-here-wont-even-check - > http://domain.com/page.php?id=55
Mi go是(最后一次重定向是一个旧的>新域名。它也是通过cPanel完成的):
RewriteEngine On
#Options +FollowSymLinks
RewriteBase /
RewriteRule ^article/(.+)/(.+) page.php?id=$1
RewriteCond %{HTTP_HOST} ^oldname.com$
RewriteCond %{REQUEST_URI} ^oldname.com [NC]
RewriteRule ^(.*)$ http://newname.com/$1 [L,R=301]
是对的吗?如果是这样,任何想法可能是错的?
答案 0 :(得分:0)
试一试,看看它是否适合你。
RewriteEngine on
RwritteBase /
RewriteRule ^article/([^/\.]+)(/.*)?$ page.php?id=$1
RewriteCond %{HTTP_HOST} ^oldname\.com
RewriteCond %{REQUEST_URI} ^oldname\.com
RewriteRule (.*) http://newname.com/$1 [R=301,QSA,L]