WordPress.org

Ready to get started?Download WordPress

Forums

htaccess, custom mod_rewrite, and weird URL construction issue (15 posts)

  1. SidianMSJones
    Member
    Posted 4 years ago #

    Still battling this one and still seeing posts by others that aren't finding answers either. :\

    The sites I make using Multisite come out with this URL structure: http://www.mymythos.orgmymythos_orgsidian/

    Everyone (DreamHost staff and WP Forum Mods) seems to say that it must be something to do with the htaccess and something called the custom mod_rewrite. But alas, I'm not much of a coder and my research isn't yielding much useful info for me.

    But here is my htaccess at the moment:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>
    
    # END WordPress

    I was told before that this block of code looks fine, but I thought I'd post again for others to take a double look.

    Hopefully if we can make a breakthrough with one case of this, then the group of others experiencing it should be able to use this knowledge as well.

  2. SidianMSJones
    Member
    Posted 4 years ago #

    Also if it helps, I customized my permalinks by adding: /%category%/%postname%/

  3. SidianMSJones
    Member
    Posted 4 years ago #

    Oh yes, and before I forget! I also got the "existing wordpress network" warning at one point but haven't seen it since. ??

  4. SidianMSJones
    Member
    Posted 4 years ago #

    Checking out the items in PhpMyAdmin seems to have just revealed that I have duplicates of a bunch of things, or maybe I'm reading this wrong, but there are a lot of entries that look like this:

    wp_4kegu2_comments
    wp_4kegu2_comments (1)

    Could this be the root of the issue?

  5. YES! :D

    thought I was going insane...

  6. jo_inge_arnes
    Member
    Posted 4 years ago #

    The database name in the URL is the same as I decribed here:

    http://wordpress.org/support/topic/419042

    The mymythos_orgsidian-part of your URL is the database name. It's supposed to be a slash, but the wp-config.php has a line at the end of the file that sets the variable $base to DB_NAME, thus causing new sites to be given a wrong base path. Result: Weird URLs

  7. jo_inge_arnes
    Member
    Posted 4 years ago #

    (I also have Dreamhost PS, btw)

  8. uh, yeah. Those variables defined in your config files aren't in any of my installs.

    Either fantastico or Dreamhost is adding those lines. See original code here:

    http://core.trac.wordpress.org/browser/trunk/wp-config-sample.php

  9. SidianMSJones
    Member
    Posted 4 years ago #

    So would I just go through and delete each of those duplicate items? Or is there a more thorough/precise way to do this?

  10. midwestmedia
    Member
    Posted 4 years ago #

    I thought I was going crazy but I have the same exact issue and I'm also on a Dreamhost PS.

    Here's the reply that I got back from support about how he fixed it the first time (the first sub-domain I created):

    That url is an issue internal to wordpress configuration. Ive corrected it for you. If this issue pops up with each new blog you create you may need to check and see what in wordpress` settings may be adding that additional text to the urls.

    When I asked specifically what the issue was so I could correct it myself I received this reply:

    1. Visit your phpMyAdmin (you can get your login details by peeking at
    your wp-config.php)

    2. Click into the database that is running your MU installation.

    3. Once you are switched to the database, click the link for the
    wp_options_2 table (it may have a slightly different name in each DB
    like: wp_iqc0rp_options_2)

    4. Once the page loads on the right hit the "browse" button, and look
    through the entries. There will be a blogurl entry and a home_page entry
    that will both have the incorrect URL in it.

    5. Hit the "pencil" icon to allow you to edit the field that pops up.

    6. Correct the URL and hit "save", then repeat the process with the other
    messed up url.

    ...which is fine if I want to fix it for each sub-domain (because the issue is recreated with every new sub-domain for me) but it's not a terribly efficient way of dealing with it longterm.

    So ANY help to isolate this issue and pass the info back to Dreamhost for future support issues would be hugely appreciated because it's terribly frustrating. Any way to do this more easily than a manual edit?

  11. SidianMSJones
    Member
    Posted 4 years ago #

    Huh, so that fix only works on a manual per-site basis? That would be extremely inefficient for me.

  12. I have already contacted Dreamhost as noted in other threads.

    It's from extra code added by Dreamhost to the wp-config.php file via their One-Click installer.

    To *really* fix it, go edit your config file and take out the $base line at the bottom. This will not only fix the issue but prevent it from being added to new blogs as well.

    See thread here:
    http://discussion.dreamhost.com/thread-126948-post-128112.html#pid128112

    Also, a fresh manual install (not a one-click) will also fix it.

  13. midwestmedia
    Member
    Posted 4 years ago #

    Thanks Andrea, I got the same response this morning. It appears they are working on a fix on their end.

  14. The holiday weekend slowed 'em down.

  15. hzlzh
    Member
    Posted 4 years ago #

    I've solve this error
    just remove this lines

    $server = DB_HOST;
    $loginsql = DB_USER;
    $passsql = DB_PASSWORD;
    $base = DB_NAME;

    which was generated by DH

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.