The MU forums have moved to WordPress.org

is .htaccess correct yet? (26 posts)

  1. spaceman
    Inactive
    Posted 18 years ago #

    I'm reading a lot of problems with the .htaccess files & rewrites. The date look like this has been a problem for quite sometime. Is the file not correct yet?

  2. plainsman
    Member
    Posted 18 years ago #

    spaceman, for what it is worth, this post

    http://mu.wordpress.org/forums/topic/393

    contains a good .htaccess file.

    when used in conjunction with updates from the latest nightly it worked wonders for us.

  3. techwench
    Inactive
    Posted 18 years ago #

    Change these two lines in your .htaccess file:

    RewriteRule ^([_0-9a-zA-Z-]+)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]

    RewriteRule ^([_0-9a-zA-Z-]+)/wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

    to this:

    RewriteRule ^([_0-9a-zA-Z-]*)/?files/(.*) /wp-inst/wp-content/blogs/$1/files/$2 [L]

    RewriteRule ^([_0-9a-zA-Z-]*)/?wp-content/blogs/(.*)/files/(.*) /wp-inst/wp-content/blogs/$1/files/$3 [L]

    It may or may not work for everyone.

  4. seanshaghaghi
    Inactive
    Posted 18 years ago #

    Thanks, that worked for me

  5. ballen
    Member
    Posted 18 years ago #

    Can we just sticky this post to the top? It will save everyone a whole lot of pain and heartache... It worked for me and seanshaghaghi... I am sure a few others too...

  6. zox
    Inactive
    Posted 18 years ago #

    This doesn't work for me.

  7. partypageusa
    Member
    Posted 18 years ago #

    Not sure why this doesnt work for me.

  8. jaseone
    Inactive
    Posted 18 years ago #

    zox,

    If you want help with your rewrite rules you are going to have to provide details of the behavior you are seeing like the URL the images should be at, what that is being rewritten to, where the files are on the physical file system, are they even being created, are you using virtual hosts or subdirectories and everything like that.

  9. zox
    Inactive
    Posted 18 years ago #

    Well for example, one of image URLs is:
    http://domain.com/blog/wpmu/files/2005/10/image.gif

    It's on administrator blog. Files have been created in /domain.com/htdocs/blog/wpmu/wp-inst/wp-content/blogs.dir/1/files/2005/10 folder.

  10. jaseone
    Inactive
    Posted 18 years ago #

    Are you using virtual hosts for the other blogs or are they within subdirectories of http://domain.com/blog/wpmu?

    The reason you are having so many grief is because most of us have it installed at the root so http://domain.com is the admin blog and http://user.domain.com is a member's blog so your .htaccess is going to be different.

    I'm no whizz with .htaccess myself but I think you at least need a RewriteBase /blog/wpmu` at the beginning of your file.

  11. partypageusa
    Member
    Posted 18 years ago #

    I have my set up on the main domain like you did jaseone. but the image will still not show itself.

  12. mediast
    Member
    Posted 18 years ago #

    I have the typical setup as well... File (pic) uploads are broken... Tried changing the two .htaccess lines above as well swapping my .htaccess file for the .htaccess file posted here. The files are uploaded to the blog.dir/1/files/2005/* folders and load properly if I punch in the true URL.

    WPMU is installed as root
    Subdomains work (BTW: the logout link does not work for subdomains -- unless I manually change the logout path to the root domain logout path).
    Pretty much every thing else seems to be working correctly (although I've noticed a few other quirky things that I really should make note of at some point).

    Nick

  13. rezilient
    Inactive
    Posted 18 years ago #

    Logout link does not work for me as well.

  14. sskhalsa
    Member
    Posted 18 years ago #

    i got it in the root directory, but images do not link correctly, jasone, could please u post the part of ur .htaccess that deals with this?

  15. mirsasha
    Member
    Posted 18 years ago #

    Wonderful! The above changes to the .htaccess file fixed the problem I was having with uploaded images not showing. Thanks for posting it.

  16. partypageusa
    Member
    Posted 18 years ago #

    man why doesn't that change work for me? thats the only problem I have besides the import before I can roll this out.

  17. billdennis
    Inactive
    Posted 18 years ago #

    I didn't work for me either. This is really getting frustrating.

    Here is my problem. I go to the main site: "http://blogpeoria.com". I created a new blog, and was sent a confirmation of a new blog at "http://sample.blogpeoria.com" I clicked on that link and I got a message saying that this location did not exist.

    This same think was happening before i performed this change to .htaccess and after it.

    There's not even a site "http://blogpeoria.com/sample"

    I should note that I installed this the contents of the WPMU folder directly into my public_html folder. I also cannot access the dashboard for http://blogpeoria.com.

    What is the world is wrong? I will do anything to get this fixed.

  18. ivanhoe
    Inactive
    Posted 18 years ago #

    ok, images finally started working, with a help of a hint above. Thanx man :)

    I changed this two lines in .htaccess, and I also had to manually create directory structure (blogs.dir/[blog_num_here]/files) for existing blogs, since upgrade.php didn't.

  19. jfitzell
    Inactive
    Posted 18 years ago #

    Those still having problems may want to try adding the following line to wp-inst/wp-content/.htaccess:

    AcceptPathInfo On

    I had one web server that didn't have this enabled by default and it wouldn't work.

  20. ergate
    Member
    Posted 18 years ago #

    Something I have noticed. I am having problems getting images to show as well, the same problem as above. I upload the photo, but I only get broken links. I ftp and check the directory and the file is there. I have wpmu installed at root, with virtual server on.

    Now the thing I have noticed, maybe this is a problem with others. When I try to go through and change the two lines as mentioned above, I cannot write the file, it is owned by apache. so everytime I make the correction and try and save it, it doesnt take. I am contacting my sysadmins to have them go through and make the correction. But I have also noticed that eventhough I have upgraded to the latest nightly build, my htaccess has not. It is still the same as with the initial install. This maybe what is causeing some hangups.

  21. ergate
    Member
    Posted 18 years ago #

    Update: The two changed lines in the htaccess file did work. Once I got around the problem with ownership and not having permission to edit the file, it works just fine.
    I like the way this handles image files.

  22. Delbert
    Member
    Posted 18 years ago #

    I've edited .htaccess with the two magic lines (yay! pictures show in the admin account), updated the site, but still no pictures on subdomains. Any ideas why? Anyone?

    Edit: Ivanhoe, what was that about editing folder structure manually? Where do you do that?

  23. Delbert
    Member
    Posted 18 years ago #

    Fixed it. Something somewhere doesn't like spaces in the filename.

    Thanks to all who posted fixes for this file upload problem.

  24. doggy
    Inactive
    Posted 18 years ago #

    okay here's a question. I have a couple other image directories that i want to be available from the main page (ie. the wpmu blog, since it's at my tld).

    so... http://www.blog.com, http://www.blog.com/photos1/, http://www.blog.com/photos2/, etc...

    now, if I take out the catch all rules I can see the directories fine, but when I click on any WPMU-related links i get nothing - zero, zilch, nada...

    ideas?

  25. ivanhoe
    Inactive
    Posted 18 years ago #

    doggy, just create a file named .htaccess in those directories with photos, and put this line in it:

    RewriteEngine Off

    That tells apache not to use mod_rewrite when serving anything in that dir or any of it's subdirs...

  26. jackaldu
    Member
    Posted 17 years ago #

    Hey i have problem with uploading files. I get an error
    /httpdocs/wp-content/blogs.dir/1/files/ Couldn’t be created.

    When I looked it to it I find out that directory blogs.dir has a different Group owner (“apache”) then rest of directories. I found out also that if I create this directories myself files are uploaded but when they are created automatically I cant upload any files. Any ideas how to solve it?

About this Topic

  • Started 18 years ago by spaceman
  • Latest reply from jackaldu