[resolved] Redirection from http:// to www. (8 posts)

  1. caylean
    Posted 4 years ago #

    Since I use the network function, my main blog is only accessible by http://www.domain.tld and the http://domain.tld produces an error message: "The registration has been disabled." What did I do wrong?
    Before i activated the Multiblog funktion it was function like i wanted it, but now the domain without the www. (http://www.domain.tld) is redirected to http://www.domain.tld/wp-signup.php?new=domain.tld

    But I would like that the http://domain.tld redirects to http://www.domain.tld
    Is the problem maybe in the files i had to change?

    Changes Files:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]


    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.example.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    Maybe somebody is able to help me out with this.

  2. smartobject2
    Posted 4 years ago #

    You might try editing the .htaccess to redirect non-www requests to www.
    Just google htaccess non-www to get the code.
    Also, if you can get to phpMyAdmin and check the wp_options table for "home" and "siteurl" and be sure they both have the www (may be unnecessary with the htaccess change?)

    Here's my htaccess but confirm with others,

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

    Also, you are probably using the "example.com" as an "example" and I dont need to say this, but... confirm your wp-config file has your url for domain current site.

    I just recently went through this for multisite, too.

  3. caylean
    Posted 4 years ago #

    Thanks, i tried already to redirect with htaccess, but it wasn't function. After that he redirected all blogs, not only http://example.com, it also redirected http://blog.example.com.

    Now I have created the multiblog on http://example.com, after the install I created a www subdomain blog, for the main site and the www i used one theme where I deleted the complete index file and pasted my content into it. Both sites are doing now what they have to, BUT.

    I have now an other Problem. I created around 30 Subdomains, together with some Friends. And while I was checking the subdomains, I made a mistyping. Instead of blog1.example.com I wrote blof1.example.com.
    Now he redirects me to a totally other site: http://example.com/wp-signup.php?new=blof1
    Here I get the information: Registration has been disabled.

    How I can stop that? If somebody make a mistyping, how i can send him to an error or blank page?

    The way how it is right now just looks totally ugly!


  4. Put this in your wp-config file:

    define( 'NOBLOGREDIRECT', 'http://yourdomain.com/' );
  5. FWIW, the www/non-www issue was probably a mis-match of your wp_blogs table and your wp-config :/ Inconsistencies cause weird problems.

    As for the registration thing, that is the error page. "Sorry, blof1 doesn't exist".

    If you want to send them to a special page, you can put this in your wp-config.php file.

    define( 'NOBLOGREDIRECT', 'http://URL I Want you to go to/' );

  6. caylean
    Posted 4 years ago #

    That sound really great and would help me very much.
    define( 'NOBLOGREDIRECT', 'http://URL I Want you to go to/' );
    Is it also possible to get this redirection somehow language specified?
    So that i can send the complete international mistyping Traffic to an English Error Page and all German mistyping Traffic, to an German Page?

    I know, thats no more up to WordPress, but maybe somebody knows.


  7. Not via wordPress natively, since it wouldn't really know a German typo from any other language.

  8. caylean
    Posted 4 years ago #

    Okay, for me i have my optio whats 'function' so i let it in that way.


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.