Help to use no www

Username (e.g. epiz_XXX) or Website URL

(please specify the website or account you are asking about)
www.foro.rmesystems.com

Error Message

(please share the FULL error message you see)
Hello.
firstly apologies for my english.
I have a website that is:
www.foro.rmesystems.com
and what i want to do is redirect to without www, but it doesn’t work for me.
how can i redirect my site to without www? Thanks a lot.

I leave my .htacces file.

Other Information

(other information and details relevant to your question)

.htaccess file.

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


# In order for the web server to process this file it must be renamed to ".htaccess"

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /

    RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
    RewriteRule . %1/%2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

Use this .htaccess code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
2 Likes

thanks for the reply.

it does not work.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.foro.rmesystems.com [NC]
RewriteRule ^(.*)$ http://foro.rmesystems.com/$1 [L,R=301]


# In order for the web server to process this file it must be renamed to ".htaccess"

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /

    RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
    RewriteRule . %1/%2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

Did you clear your cookies? Sometimes .HTACCESS files get cached by the browser.

yes donth work

It seams to be working for me. If you use Cloudflare, make sure you clear that cache as well.
Thanks

you put:
www.foro.rmesystems.com

and automatically redirects you to

http://rmesystems.com
??

try https: // www.foro.rmesystems.com

It works perfectly fine for me. On going to www.foro.rmesystems.com I get redirected to http://rmesystems.com.

Like @Greenreader9 said, its most likely just a cache issue.

3 Likes

The RewriteEngine On statement here disables all rewrite rules defined before, including your non-www redirect. Simply remove that line to make the .htaccess rules take effect.

3 Likes

try with:

https://www.foro.rmesystems.com

and it does not work

It’s okay like that?
Because it does not work.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.foro.rmesystems.com [NC]
RewriteRule ^(.*)$ http://foro.rmesystems.com/$1 [L,R=301]


# In order for the web server to process this file it must be renamed to ".htaccess"

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    #RewriteBase /

    RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
    RewriteRule . %1/%2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
</IfModule>

That redirects me to http://foro.rmesystems.com/

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com [NC]

RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

If it doesn’t work, Go to chrome://settings and clear cached images and files.

Could you please put the entire .htaccess file in a code block so Discourse won’t try to parse it as markup?

2 Likes

how do I do that?

with https? That weird did not work for me. I tried it with my cell phone and another browser.
if I put www.foro.rmesystems.com it redirects me to http://foro.rmesystems.com

but if I put https://www.foro.rmesystems.com: I get:

This website cannot provide a secure connection
The www.foro.rmesystems.com page uses an unsupported protocol.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH

It seems your website does not have a valid SSL certificate.

Because your website is not secure. Please make sure that your SSL certificate is properly installed.

To use https:// you need a valid SSL certificate installed on your website. You are getting the unsuported protocol error, because a SSL certificate cannot be found. You can only use http:// without an SSL certificate. (And redirecting to without www. on http is working just fine.)

To add a SSL certificate (and https://) to your website:

1 Like

if I put https://foro.rmesystems.com it works.
ssl certificate does not cover with www. that’s why I want to direct to https://foro.rmesystems.com.
but it does not work

Try this on your .htaccess on your foro subdomain:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^foro.rmesystems.com [NC]
RewriteRule ^(.*)$ https://foro.rmesystems.com/$1 [L,R=301]

Try adding that rule on your subdomain htaccess file and not your main one in the htdocs folder.