• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

    • ⚠️ Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • ✅ Confirm that the server meets the System Requirements
    • 🔥 Check for any available Hotfix - your issue could be already reported/fixed
    • 📚 Read documentation - It will be required to Debug and understand Errors for a faster support response

How to redirect domain.com to www.domain.com is this possible?

shivaya

Chevereto Member
Hello

hope someone can help me...

not sure if this is possible but can I redirect domain.com to www.domain.com ?
because at this moment both versions of my website are working..google bot is picking /indexing random webpages with or without www. i wanna index only with www

i know i can do this editing htaccess but the file is full of other codes so im not sure how to do it or if it would messed up with the chevereto script.. if i can only edit htaccess to fix it please tell me whats the code to paste in there

thank you i apreciate the help

cheers
 
As long a you don't put the code in a rule declaration you will be fine. If you want to know where is best ot put the code? I will say just after the RewriteBase line.
 
Like this?

....
#RewriteBase /

# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

# 404 images
.....


do I need to have blank lines or it doesnt matter?
 
if that matters this is the code I have on my htaccess thank you

# Disable server signature
ServerSignature Off

# Disable directory listing (-indexes), Multiviews (-MultiViews) and enable Follow system links (+FollowSymLinks)
Options -Indexes
Options -MultiViews
Options +FollowSymLinks

<IfModule mod_rewrite.c>

RewriteEngine On

# If you have problems with the rewrite rules remove the "#" from the following RewriteBase line
# You will also have to change the path to reflect the path to your Chevereto installation
# If you are using alias is most likely that you will need this.
#RewriteBase /

# 404 images
# If you want to have your own fancy "image not found" image remove the "#" from RewriteCond and RewriteRule lines
# Make sure to apply the correct paths to reflect your current installation
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule images/.+\.(gif|jpe?g|png|bmp) - [NC,L,R=404]
#RewriteRule images/.+\.(gif|jpe?g|png|bmp) content/images/system/404.gif [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpe?g|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]
RewriteRule . index.php [L]

</IfModule>
 
since I did this my website stop working again.. now I am getting this error

Parse error: syntax error, unexpected '[' in /home/DOMAINSUSER/public_html/app/loader.php on line 123

and seems arvixe support cant fix it too =(
i already tryed to restore htaccess file which was the only one I edited without success
 
arvixe support finaly fixed it. they had to restore my backup server to last few days ...

not sure why but that code you gave me messed up with the script and made it stop working
anyway its not a big deal anyway...so if you want just nevermind it

but if you could find a working solution for redirecting non-domain to www-domain or maybe even implement it in next chevereto update version I am sure others users will apreciate it too....

regards
 
Back
Top