Won’t redirect http://www.domainname.net/ to http://www.domainname.net/news/

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]

RewriteCond %{HTTP_HOST} ^domainname.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.domainname.net$
RewriteRule ^/?$ "http://www.domainname.net/news/" [R=301,L]

Okay I would like to use cPanel to redirect:

domainname.net/

To this path on the same domain:

Read More
domainname.net/news/

Anyways when I enter domainname.net/ it doesn’t redirect as it should.

The .htacess I am using is above.

Related posts

Leave a Reply

2 comments

  1. This chunk of code—specifically the last line—seems off:

    RewriteCond %{HTTP_HOST} ^domainname.net$ [OR]
    RewriteCond %{HTTP_HOST} ^www.domainname.net$
    RewriteRule ^/?$ "http://www.domainname.net/news/" [R=301,L]
    

    I would suggest replacing it with this instead:

    RewriteCond %{HTTP_HOST} ^domainname.net$
    RewriteRule (.*) http://www.domainname.net/$1 [R=301,L]
    RewriteRule ^$ news [L]
    
  2. How about:

    RewriteCond %{HTTP_HOST} ^domainname.net$ 
    RewriteCond %{HTTP_HOST} ^www.domainname.net$ 
    RewriteRule ^(.*)$ http://domainname.net/news/ [R=301,L]