WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Redirect from my main blog to a subdomain (24 posts)

  1. multiday
    Member
    Posted 2 years ago #

    my blog, multidays.com is being redirected to a subdomain ultranews.multidays.com My hosting company after trying to figure out for an hour what was happening gave up and said it was proably a plugin, wp super cache, for which they arent responsible. I have deactivated all the plugins to no effect. I deactivated the subdomain which strangely also seemed to have no affect. I cant think of any changes I made that would account for this as the site was working fine until yesterday.
    Where do I start looking for the problem?

  2. What's in your .htaccess?

    What do you mean you 'deactivated' the subdomain?

  3. multiday
    Member
    Posted 2 years ago #

    hi thanks for replying. I "deactivated" the subdomain in the network sites section. I assumed it prevented it from being visible then I re-activated it.
    There isnt any redirect to that url in the htaccess but I dont know much about how it works.

  4. Yeah, that won't help :) The deactivating.

    How did you set up subdomains on the server?

  5. multiday
    Member
    Posted 2 years ago #

    I setup the subdomain in wordpress first then created the subdomain in cpanel.

  6. Okay, how did you set it up in cpanel?

    Can you screenshot what that page looks like?

    Should look like this: http://cl.ly/2F1C0z0Y0W2g422x3G2A

  7. multiday
    Member
    Posted 2 years ago #


    there is a place
    where you created subdomains in cpanel, I added it there.

  8. multiday
    Member
    Posted 2 years ago #

    another thing I discovered while looking into this was that 2 of these subdomains are no longer functioning - 51 days and newmexicoultras

  9. I see you have wildcards setup.

    Are the other subdomains, the named ones like newmexicoultras, really pointing to separate installs?

  10. multiday
    Member
    Posted 2 years ago #

    Those missing two were not separate installs but created within the network sites section. Ultranews is separate. Also I can include .htaccess if you want to look at it, its clear I dont know what I'm doing.

  11. Okay. For all subdomains that are actually handled (or supposed to be) by wordpress, DELETE the entry in cpanel. The wildcard entry at the top should handle that.

    And yeah, let's peek at the .htaccess and rule that out if we can.

  12. multiday
    Member
    Posted 2 years ago #

    ok, thats great. A real help - those two sites have reappeared.

  13. multiday
    Member
    Posted 2 years ago #

    Another thing that comes to mind and I dont know if its relevant, is that when I turned on the multisite functionality I think I went for subfolders rather than subdomains.
    I can login thru /wp-login.php to access multidays.com but in the browsers it doest work on the live site.

  14. You can find out for sure looking at your wp-config.php file.

    See if you have define( 'SUBDOMAIN_INSTALL', false ); or define( 'SUBDOMAIN_INSTALL', true );

    (Still waiting on the .htaccess BTW ;) )

  15. multiday
    Member
    Posted 2 years ago #

    Sorry, i thought i posted it

    # -FrontPage-
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName www.multidays.com
    AuthUserFile /home/multiday/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/multiday/public_html/_vti_pvt/service.grp
    #RewriteCond %{HTTP_HOST} ^.*$
    #RewriteRule ^multidays.com/html/adventure_racing/is_adventure_racing_new_pinnacle.htm$ "http\:\/\/multidays\.com\/2006\/09\/10\/is\-adventure\-racing\-the\-new\-pinnacle\-of\-endurance\-sports\/" [R=301,L]
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^html\/triathlon\/preparation\/triathlon_plan\.htm$ "http\:\/\/multidays\.com\/2009\/04\/13\/triathlon\-race\-plan\/" [R=302,L]
    
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^SMF\/index\.php\/?(.*)$ "http\:\/\/multidays\.com\/bbpress\/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^multidays.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^html\/calendar\/?(.*)$ "http\:\/\/multidays\.com\/the\-multiday\-and\-ultra\-marathon\-calendars\/$1" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^multidays.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^public_html\/html\/calendar\/calender1\.htm$ "http\:\/\/multidays\.com\/the\-multiday\-and\-ultra\-marathon\-calendars\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^html\/articles\/energy_gels\.htm$ "http\:\/\/multidays\.com\/energy\-gels\-sports\-gels\-sports\-bars\-and\-sports\-drinks\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^multidays.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^html\/articles\/energy_gels\.htm$ "http\:\/\/multidays\.com\/energy\-gels\-sports\-gels\-sports\-bars\-and\-sports\-drinks\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^multidays.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^html\/calendar\/calender1\.htm\/?(.*)$ "http\:\/\/multidays\.com\/the\-multiday\-and\-ultra\-marathon\-calendars\/$1" [R=302,L]
    
    RewriteCond %{HTTP_HOST} ^multidays.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.multidays.com$
    RewriteRule ^html\/articles\/?(.*)$ "http\:\/\/multidays\.com\/articles\/$1" [R=301,L]
    
    # BEGIN W3TC Browser Cache
    #<IfModule mod_deflate.c>
    #    <IfModule mod_setenvif.c>
    #        BrowserMatch ^Mozilla/4 gzip-only-text/html
    #        BrowserMatch ^Mozilla/4\.0[678] no-gzip
    #        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    #        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    #    </IfModule>
    #    <IfModule mod_headers.c>
    #        Header append Vary User-Agent env=!dont-vary
    #    </IfModule>
    #    <IfModule mod_filter.c>
    #        AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
    #    </IfModule>
    #</IfModule>
    #<FilesMatch "\.(css|js|CSS|JS)$">
    #    FileETag None
    #    <IfModule mod_headers.c>
    #         Header set X-Powered-By "W3 Total Cache/0.9.2.3"
    #    </IfModule>
    #</FilesMatch>
    #<FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
    #    FileETag None
    #    <IfModule mod_headers.c>
    #         Header set X-Powered-By "W3 Total Cache/0.9.2.3"
    #    </IfModule>
    #</FilesMatch>
    #<FilesMatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|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|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|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)$">
    #    FileETag None
    #    <IfModule mod_headers.c>
    #         Header set X-Powered-By "W3 Total Cache/0.9.2.3"
    #    </IfModule>
    #</FilesMatch>
    ## END W3TC Browser Cache
    ## BEGIN W3TC Page Cache core
    #<IfModule mod_rewrite.c>
    #    RewriteEngine On
    #    RewriteBase /
    #    RewriteRule ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 [L]
    #    RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9\-\.]+\.[a-z]+)\.?(:[0-9]+)?$
    #    RewriteRule .* - [E=W3TC_DOMAIN:%2]
    #    RewriteCond %{HTTP_USER_AGENT} (2\.0\ mmp|240x320|alcatel|amoi|asus|au\-mic|audiovox|avantgo|benq|bird|blackberry|blazer|cdm|cellphone|danger|ddipocket|docomo|dopod|elaine/3\.0|ericsson|eudoraweb|fly|haier|hiptop|hp\.ipaq|htc|huawei|i\-mobile|iemobile|j\-phone|kddi|konka|kwc|kyocera/wx310k|lenovo|lg|lg/u990|lge\ vx|midp|midp\-2\.0|mmef20|mmp|mobilephone|mot\-v|motorola|netfront|newgen|newt|nintendo\ ds|nintendo\ wii|nitro|nokia|novarra|o2|openweb|opera\ mobi|opera\.mobi|palm|panasonic|pantech|pdxgw|pg|philips|phone|playstation\ portable|portalmmm|\bppc\b|proxinet|psp|qtek|sagem|samsung|sanyo|sch|sec|sendo|sgh|sharp|sharp\-tq\-gx10|small|smartphone|softbank|sonyericsson|sph|symbian|symbian\ os|symbianos|toshiba|treo|ts21i\-10|up\.browser|up\.link|uts|vertu|vodafone|wap|willcome|windows\ ce|windows\.ce|winwap|xda|zte) [NC]
    #    RewriteRule .* - [E=W3TC_UA:_low]
    #    RewriteCond %{HTTP_USER_AGENT} (acer\ s100|android|archos5|blackberry9500|blackberry9530|blackberry9550|blackberry\ 9800|cupcake|docomo\ ht\-03a|dream|htc\ hero|htc\ magic|htc_dream|htc_magic|incognito|ipad|iphone|ipod|kindle|lg\-gw620|liquid\ build|maemo|mot\-mb200|mot\-mb300|nexus\ one|opera\ mini|samsung\-s8000|series60.*webkit|series60/5\.0|sonyericssone10|sonyericssonu20|sonyericssonx10|t\-mobile\ mytouch\ 3g|t\-mobile\ opal|tattoo|webmate|webos) [NC]
    #    RewriteRule .* - [E=W3TC_UA:_high]
    #    RewriteCond %{HTTP_COOKIE} w3tc_referrer=.*(google\.com|yahoo\.com|bing\.com|ask\.com|msn\.com) [NC]
    #    RewriteRule .* - [E=W3TC_REF:_search_engines]
    #    RewriteCond %{HTTPS} =on
    #    RewriteRule .* - [E=W3TC_SSL:_ssl]
    #    RewriteCond %{SERVER_PORT} =443
    #    RewriteRule .* - [E=W3TC_SSL:_ssl]
    #    RewriteCond %{HTTP:Accept-Encoding} gzip
    #    RewriteRule .* - [E=W3TC_ENC:.gzip]
    #    RewriteCond %{REQUEST_METHOD} !=POST
    #    RewriteCond %{QUERY_STRING} =""
    #    RewriteCond %{REQUEST_URI} \/$ [OR]
    #    RewriteCond %{REQUEST_URI} (sitemap\.xml(\.gz)?) [NC]
    #    RewriteCond %{REQUEST_URI} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php) [NC,OR]
    #    RewriteCond %{REQUEST_URI} (wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php) [NC]
    #    RewriteCond %{HTTP_COOKIE} !(comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in) [NC]
    #    RewriteCond %{HTTP_USER_AGENT} !(W3\ Total\ Cache/0\.9\.2\.3) [NC]
    #    RewriteCond "%{DOCUMENT_ROOT}/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" -f
    #    RewriteRule .* "/wp-content/w3tc-%{ENV:W3TC_DOMAIN}/pgcache/%{REQUEST_URI}/_index%{ENV:W3TC_UA}%{ENV:W3TC_REF}%{ENV:W3TC_SSL}.html%{ENV:W3TC_ENC}" [L]
    #</IfModule>
    # END W3TC Page Cache core
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    
    # END WordPress
    
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^html\/24_hour_pages\/24_hr_index\.htm$ "http\:\/\/multidays\.com\/the\-24\-hour\-race\-pages\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^multidays\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.multidays\.com$
    RewriteRule ^public_html\/html\/personal_accounts\/personal_accounts_by_name\.htm$ "http\:\/\/multidays\.com\/the\-24\-hour\-race\-pages\/" [R=301,L]
    
    #Expire Header
    <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf)$">
    ExpiresDefault "access plus 2 months"
    </FilesMatch>
  16. multiday
    Member
    Posted 2 years ago #

    define('WP_ALLOW_MULTISITE', true);

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

  17. multiday
    Member
    Posted 2 years ago #

    then there the keys and then this is the last entries in wp-config:
    /** WordPress absolute path to the WordPress directory. */

    if ( !defined('ABSPATH') )

    define('ABSPATH', dirname(__FILE__) . '/');

    /** Sets up WordPress vars and included files. */

    require_once(ABSPATH . 'wp-settings.php');

    define('WP_ALLOW_REPAIR', true);

  18. Atch. You did and it's enoumous and it was caught by spam. Okay.

    Don't worry about wp-config. You have waaaay too much in your .htaccess, and some of it makes no sense. So [ull it back to this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    
    # END WordPress

    Yeah, JUST that. See if that works. Then we can add things back in.

  19. multiday
    Member
    Posted 2 years ago #

    ok i deleted everything and added the above.Everything seems to be the same

  20. multiday
    Member
    Posted 2 years ago #

    I can log in to the wordpress installation - everything seems fine there. its just the live site. I can reach the wiki on the site but not posts or pages.

  21. multiday
    Member
    Posted 2 years ago #

    I managed to fix the problem. I thought I had deactivated the Redirection plugin, however this morning I noticed it was still there under Tools. A google search brought me to this page and they mentioned deleting some database rows: when I looked, there were entries there for each subdomain so I cleared them all out and now it working fine.

    I guess the only question I have now is what to do about cleaning up that .htaccess file - seems daft to put a whole bunch of junk back in there.

    Ipstenu, many thanks for your help. You helped me help myself and in the end it wasn't the nightmare the unknown is usually perceived as. This is a great job you do here. Best wishes, Abichal

  22. multiday
    Member
    Posted 2 years ago #

    Uhhh, ok, the redirect has ceased but then I got a Not Found error:
    Not Found

    The requested URL /2012/05/longest-night-langstenachtlauf-2412-hour-race-2012/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    So it seemed I had to clear the ,htaccess file and replace it with the basic format as you suggested, somehow I thought I had done it but hadnt. So then the links didnt work so I changed the permalink structure to default, cleared the caches, and finally links worked but not the pretty links. rebuilt the .htaccess file and finally the links worked and all the posts and pages are accessible however now the images are not showing.

  23. multiday
    Member
    Posted 2 years ago #

    Actually the images are showing in the post its just the frontpage images not working. Possibly i have to edit the theme.

  24. multiday
    Member
    Posted 2 years ago #

    Dohh wrong theme. OK. Thats it. Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic