-1

Can anybody help me to redirect my website from www.dipscoochbehar.com to http://dipscoochbehar.com

This is what I wrote in htaccess file:

# 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

And I got the below error: This is the error I got in console when I tried to access the website

<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>
Amit Goel
  • 43
  • 6
  • ** 500 Internal Server Error

    Internal Server Error

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

    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.

    More information about this error may be available in the server error log.


    Apache/2.4.18 (Ubuntu) Server at www.example.com Port 80
    **
    – Amit Goel Sep 25 '19 at 07:51
  • this above is the error I am getting – Amit Goel Sep 25 '19 at 07:51
  • Please go read [ask]. You have neither shown us, what you actually tried inside your .htaccess, nor what the actual error is. (The message you quoted already hinted that you should check the error logs.) – 04FS Sep 25 '19 at 07:58
  • @04FS thanks for the suggestion. I have made the suggested changes. – Amit Goel Sep 25 '19 at 08:05
  • Please show code as text ([properly formatted](https://meta.stackexchange.com/q/22186)), not images _of_ code. And you are still just showing the same end-user facing error message, instead of telling us what the error log actually has to say. – 04FS Sep 25 '19 at 08:07
  • RewriteRule matches against the path component of the requested URL only, you can not check the host name that way, you need to use a RewriteCond for that. – 04FS Sep 25 '19 at 08:09
  • See https://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www?rq=1 – R. Martin Sep 25 '19 at 08:22
  • @R.Martin thanks .. the link solved my problem – Amit Goel Sep 25 '19 at 09:03

1 Answers1

0

Also, avoid adding redirect rules inside WordPress section

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
Res Pro
  • 76
  • 3