Как перенаправить мой сайт с www.в http, внеся изменения в файл htaccess? - PullRequest
0 голосов
/ 25 сентября 2019

Может кто-нибудь помочь мне перенаправить мой сайт с www.dipscoochbehar.com на http://dipscoochbehar.com

Вот что я написал в файле htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /agarwalmaheswari/index.php [L]
RewriteRule www.dipscoochbehar.com /var/www/html/demosite/DIPS/index.html [R=301,L]
RewriteRule http://www.dipscoochbehar.com /var/www/html/demosite/DIPS/index.html [R=301,L]
</IfModule>

# END WordPress

И я получил нижеошибка: это ошибка, которую я получил в консоли, когда пытался зайти на сайт

<html>
    <head>
        <title>
            500 Internal Server Error
        </title>
    </head>
    <body>
        <h1>Internal Server Error</h1>

        <p>
            The server encountered an internal error or
            misconfiguration and was unable to complete
            your request.
        </p>

        <p>
            Please contact the server administrator at 
             webmaster@localhost to inform them of the time this error occurred,
             and the actions you performed just before this error.
        </p>

        <p>
            More information about this error may be available
in the server error log.</p>

<hr>

        <address>
            Apache/2.4.18 (Ubuntu) Server at www.dipscoochbehar.com Port 80
        </address>
    </body>
</html>

1 Ответ

0 голосов
/ 25 сентября 2019

Кроме того, избегайте добавления правил перенаправления в разделе WordPress

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.dipscoochbehar\.com$
RewriteRule ^(.*)$ http://dipscoochbehar.com/$1 [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /agarwalmaheswari/index.php [L]
</IfModule>

# END WordPress
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...