开发者

Updated the .htaccess and website doesn't load now.. what shall i put in to restore it?

开发者 https://www.devze.com 2023-02-05 05:38 出处:网络
thanks a million! my website is not loading now开发者_JAVA百科 .please. please.please! Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle t

thanks a million! my website is not loading now开发者_JAVA百科 .please. please.please!

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Well, now that i solved the loading page problem. I'll explain myself better...

all i wanted to do is those redirections:

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 was (the last redirect it's an old->new domain name. It's also done through 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]

Is correct? if so, any idea what could be wrong?


Try this out and see if it works for you.

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]
0

精彩评论

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

关注公众号