Website adds www. prefix

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Post Reply
zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 7:08 am

Hello,

I have copied the live joomla website to my localhost, and when I go to the site a www. prefix is automatically added. So if I type htpp://website/ it changes to www.website/ and the site isn't working. It's something in the database because it happened only after I imported the db.
Last edited by toivo on Thu May 17, 2018 10:23 am, edited 1 time in total.
Reason: mod note: moved from 3.x

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 7149
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Website adds www. prefix

Post by sozzled » Tue May 15, 2018 8:21 am

It's unlikely to be in the database. The information is either defined as part of the management of the domain within the webhosting package that you've purchased or it's defined within the .htaccess file defined within the files system used by your website. I could be wrong but I don't think it's just something that happened after importing the database; I suspect you "imported" one or more files as well.
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Re: Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 8:44 am

Hmm well I truly have no clue what could be wrong, I even tried changing some settings in .htaccess but none seemed to have helped. I am actually just an intern right now at the company so I don't know about webhosting package, would it maybe help if I paste the .htaccess file so you could check or ?

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 7149
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Website adds www. prefix

Post by sozzled » Tue May 15, 2018 8:54 am

I, personally, don't want to see the contents of your .htaccess file here on the forum! The .htaccess file may contain sensitive information that relates to your site which, in the wrong hands, could be injurious to you. I don't know what's odd about your .htaccess file but, if you are a novice then I suggest that you shouldn't attempt to make changes to the .htaccess file on your own.

Have you asked the people who manage the webhosting company where your site is located, why you can't enter the domain name without "www."?

Paste the .htaccess file here, if you want to. Whether I can help you is a different question, however.
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Re: Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 9:01 am

I reverted the changes I made to the .htaccess when I saw it didn't work. It's on my localhost so it isn't that much of a problem live site stays the same.

I'm sorry if I worded myself incorrectly, i'm actually having this problem on the copied joomla website, transfered the files with FTP and exported/imported database, basically followed the tutorial: https://docs.joomla.org/Copying_a_Joomla_website

Live site works fine, but localhost/copy site forces www. infront. I haven't talked to the people who manage, only talked to my mentor and he said it must be some settings within the files.

When I go to the administrator/backend site, the url stays normal mysite/administrator with no www. in front

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 7149
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Website adds www. prefix

Post by sozzled » Tue May 15, 2018 9:08 am

zaaanck wrote:I reverted the changes I made to the .htaccess when I saw it didn't work. It's on my localhost so it isn't that much of a problem live site stays the same.
When you write "localhost" do you mean your own computer/PC/device that you're using to type these messages on the forum?

When you write "it is on my localhost", is "it" the .htaccess file that you've been changing or is "it" the Joomla website that you have a problem with?
zaaanck wrote:Live site works fine, but localhost/copy site forces www. infront.
Hmm ... please read my thoughts on To 'localhost' or not to 'localhost', that is the question ... ;)
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

User avatar
AMurray
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4671
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Website adds www. prefix

Post by AMurray » Tue May 15, 2018 9:10 am

You shouldn't get any "www" on localhost since it's not on the World Wide Web?

If you are truly on "localhost" then the URL should be something like http://localhost/ or http://localhost/your-site-folder/ (no www prefix).
Regards,
--------------------------------------------------------------
A Murray
Millennium Falcon - it's the ship that made the Kessel run in less than 12 parsecs! The fastest hunk of junk in the galaxy.

zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Re: Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 9:20 am

sozzled wrote:When you write "localhost" do you mean your own computer/PC/device that you're using to type these messages on the forum?
Yes, I have wamp set up on this computer
sozzled wrote: When you write "it is on my localhost", is "it" the .htaccess file that you've been changing or is "it" the Joomla website that you have a problem with?
Well both actually, but I was referring to the website
sozzled wrote:Hmm ... please read my thoughts on To 'localhost' or not to 'localhost', that is the question ... ;)
I read it, and saw a sentence very familiar with my problem: "my internet site works but my localhost copy doesn't". But I really don't know what else to do than use wamp and try the website on my localhost, I am fairly new to this whole thing never managed websites before

zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Re: Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 9:23 am

AMurray wrote:You shouldn't get any "www" on localhost since it's not on the World Wide Web?

If you are truly on "localhost" then the URL should be something like http://localhost/ or http://localhost/your-site-folder/ (no www prefix).
Yes, that is exactly my problem. I am on the localhost I have wamp server and I can see the project site in my localhost projects, that is why I am so confused about this. I am guessing it's most likely some settings within the files when I copied the live website, but I have no idea what could it be

User avatar
sozzled
Joomla! Champion
Joomla! Champion
Posts: 7149
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Website adds www. prefix

Post by sozzled » Tue May 15, 2018 9:40 am

I know how to set up a xAMPx service (but the last time I needed to use one was seven or eight years ago, at least); it—resolving WAMP problems—is just not worth my time. For the very reasons that compelled me to write my thoughts about the problems associated with using WAMP/LAMP/XAMPP/xAMP stack, go knock yourself out: every xAMPx stack is different. I can't help you, sorry. Perhaps someone else who is more "in tune" with localhost-based websites might have an idea. :)

Without knowing the cause (and, as @AMurray concludes, how can a localhost-based website enforce "www." prefix?) you might try renaming the .htaccess file to something like htaccess.old and see what happens next. :pop

PS: please avoid using the pronoun "it": it introduces uncertainty about what you're trying to describe.
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

zaaanck
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Tue May 15, 2018 7:01 am

Re: Website adds www. prefix

Post by zaaanck » Tue May 15, 2018 9:49 am

Ah okay, so then this is a wamp issue and has probably nothing to do with joomla website settings? I will try and ask it on their forum then. Renaming the .htaccess file didn't do anything.

Thank you for your time


Post Reply

Return to “General Questions/New to Joomla! 2.5”