WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] www in path-based URL (14 posts)

  1. Gabriel Calil
    Member
    Posted 2 years ago #

    Hi! I was configuring a network using WordPress Multisite and then, when I was about to choose between path-based or domain-based URL, I saw this warning:

    "Server Address: We recommend you change your siteurl to wheelofcommerce.com before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like http://www.wheelofcommerce.com but any links will not have the www prefix."

    Does it mean that, when someone access my homepage, this person will see http://www.wheelofcommerce.com and, when going to any other place inside the website, will see wheelofcommerce.com (without www)?
    I know this can sound really stupid, but I prefer to ask in order to confirm: I want to know if, using the path-based URL with the www, the URLs of the "sub-sites" will be something like "www.wheelofcommerce.com/example1", which is exactly what I want the URLs to be, or "www.wheelofcommerce.com/www.example1" (with the www. before example1).

    Thanks!

  2. Does it mean that, when someone access my homepage, this person will see http://www.wheelofcommerce.com and, when going to any other place inside the website, will see wheelofcommerce.com (without www)?

    Yes.

    I want to know if, using the path-based URL with the www, the URLs of the "sub-sites" will be something like "www.wheelofcommerce.com/example1", which is exactly what I want the URLs to be, or "www.wheelofcommerce.com/www.example1" (with the www. before example1).

    They'll be wheelofcommerce.com/example1 actually, but yes, the www is on the MAIN domain :) Not the subfolder.

  3. Gabriel Calil
    Member
    Posted 2 years ago #

    So, there is absolutely no way to have the http://www.wheelofcommerce.com/whatever in my entire network? If I want to work with path-based URLs I will be forced to have my URLs like wheelofcommerce.com/whatever?

    Thanks!

  4. You can do it. You just may need to put something like this in your .htaccess.

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

    Though I suppose the question is why? As long as both work, does it matter?

  5. Gabriel Calil
    Member
    Posted 2 years ago #

    First of all, thanks! You are really fast in answering my questions. It looks like a paid support service.

    Here is how my .htaccess file is now:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    Where should I insert the code you gave me?

    There are two reasons that make me want to keep the www in the entire network:
    1-I've already paid for a professionally signed SSL certificate from DreamHost, and the certificate works only for the exact URL I've purchased it for (which in the case includes the www). I need the SSL cause I'm going to work with e-commerce.

    2-Considering that I'm going to work with e-commerce, I really need to make people know that my website is absolutely safe. I know that the www in my URL has absolutely nothing to do with safety, and I know this is something VERY silly, but people generally don't feel safe in front of a thing they are not used with. If someone goes to a website to buy a product and don't see the www (which is the standard), this person could feel unsafe and don't buy. Again, I know it sounds silly, but it's not a question of real safety, just a question of marketing.

    Thanks again! You are giving me a huge help with my questions!

  6. Put the code I gave you ABOVE the WordPress lines. Always have your personal tweaks, and put WP at the bottom. This will prevent extra calls to WordPress and keep your memory usage down :D

    By the way, reason #1 is possibly the ONLY decent reason I've EVER heard. :D So thank you for giving me one reason I'll cheerfully accept.

    #2 is ... less so. So long as www and non www display the same content, users don't care. There are studies on that from Google and others. Now that browsers are hiding http:// in their address bars, people are relaxing a little.

  7. Gabriel Calil
    Member
    Posted 2 years ago #

    Hi! Thanks again!
    Sorry for my lack of knowledge, but by "wordpress lines" do you mean that I have to put the code you gave me right above the beginning of my .htaccess (right above the "RewriteEngine On")?

  8. Yes. If it helps make things more clear, use this:

    # Redirect non-www urls to www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    
    # Begin WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # End WordPress
  9. Gabriel Calil
    Member
    Posted 2 years ago #

    Hi! Sorry for the delay. Thank you, I've already put the code in the .htaccess. It will take some days till I configure my network with the theme I want and with all the plugins. If something related to the www in the URL goes wrong and I can't resolve on my own, I come back here to ask for help.

    Thanks again!

  10. Gabriel Calil
    Member
    Posted 2 years ago #

    Hi! I'm having another problem with the www, but this time in my email addresses. Yesterday a new user had registered in my site and I received a message in my network admin email (wheelofcommerce@hotmail.com) about this new registration. The weird part is that the message came from noreply@www.wheelofcommerce.com, which I presume is the email address WordPress created automatically to notify me each time a new user register at my network. When I go to my network settings, in the section about Network admin email, there's also a message under the space to put the admin email address, "Registration and support emails will come from this address. An address such as support@www.wheelofcommerce.com is recommended." I want these email addresses to look like whatever@wheelofcommerce.com. How can I remove the www from noreply@www.wheelofcommerce.com or any other email address the WordPress system can automatically create?

    Despite I've already enabled my coming soon page to work in my entire network, it's just working in the home page, which is why a new user were able to register -I'm contacting the guys who made the plugin to solve this.

    Thanks again!

  11. WordPress DOES NOT create any email accounts. At all. Period. The noreply thing is a server default for Apache.

    "Registration and support emails will come from this address. An address such as support@www.wheelofcommerce.com is recommended."

    Okay. So you did notice the text box that you can enter any email you want in there? Just enter what you want. And yes, it's thinking it should be www. because you forced that in.

  12. Gabriel Calil
    Member
    Posted 2 years ago #

    Thanks! About the coming soon page issue, I already contacted the plugin support and they told me the plugin doesn't work in multisite. I searched for a plugin that allows me to create the coming soon page in the entire network, but didn't find one so far. Do you know a customizable coming soon page plugin that can be activated for the entire network?

    Thanks again!

  13. I've never bothered with one.

  14. _beatrice_
    Member
    Posted 2 years ago #

    Hi - I am trying to attempt the similar task and have problems

    In Softaculous I edited the WP installation to show https and put the code in the .htaccess file as well. I cannot get the www. to appear anywhere though. When I attempt to add another rewrite at the top of the file, it just loops and keeps redirecting back and forth.

    I also dont see the option to force the https for admin logins using multisite. Where do I change that?

Topic Closed

This topic has been closed to new replies.

About this Topic