WordPress.org

Ready to get started?Download WordPress

Forums

.htaccess (69 posts)

  1. stonegauge
    Member
    Posted 9 years ago #

    .htaccess

  2. stonegauge
    Member
    Posted 9 years ago #

    I admit I am very much a n00bie when it comes to a lot of this stuff -- i'm a Moveable Type convert.
    I'm trying to change my URI's to the "neat and tidy" permalink structure and that's failing with a big fat 404.
    I've been looking around for help with this and everything points to the .htaccess file but the thing is -- I don't have an HTAccess file. I don't know how to set one up for WP and what not... Like I said, I'm a noobie with this!
    Help greatly appreciated...

  3. Doraemon
    Member
    Posted 9 years ago #

    What's your URI structure?

  4. stonegauge
    Member
    Posted 9 years ago #

    /archives/%year%/%monthnum%/%day%/%postname%/
    mind you, like i said, I know nothing about setting up an .htaccess file (or making it writeable in wordpress, etc).

  5. Doraemon
    Member
    Posted 9 years ago #

    Ah, so you haven't set up your .htaccess file?

  6. Doraemon
    Member
    Posted 9 years ago #

    If you go into 'templates' under the admin page is there a link to your .htaccess file?

  7. stonegauge
    Member
    Posted 9 years ago #

    No set up Acccess file...
    If I go to Templates and click on the link to .htaccess (for rewrite rules) I get this dandy little message:
    Editing .htaccess
    Oops, no such file exists! Double check the name and try again, merci.
    -----
    SO that's not working...

  8. Doraemon
    Member
    Posted 9 years ago #

    Okay, this is because you do not have a .htaccess file, that's fine...
    Here's what you need to do:
    1. Log on to your site via FTP
    2. Open up your favorite text editor and add the rules it asks you to add to your .htaccess file
    3. Make sure that at the very top of your .htaccess file the first line is: RewriteEngine On
    4. Save your file in plain text format
    5. Upload the file to your server in the same directory that you installed WordPress to. Then rename the file to exclude all extensions and be sure to add the period at the beginning of your file. Result should be: .htaccess
    Now you're set. Let me know if you have any problems.

  9. Doraemon
    Member
    Posted 9 years ago #

    Can you post the contents of your final .htaccess file? .. and be sure to check the template page to see if it shows up in the proper place.

  10. stonegauge
    Member
    Posted 9 years ago #

    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /wp/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /wp/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp/wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp/wp-feed.php?feed=$1&withcomments=1 [QSA]

  11. Doraemon
    Member
    Posted 9 years ago #

    Ah, and one more thing, set the permission of your .htaccess file to 666...

  12. Doraemon
    Member
    Posted 9 years ago #

    Also, let me know if your .htaccess file is showing up in the templates page. If it is not, that means it's in the wrong directory.

  13. Doraemon
    Member
    Posted 9 years ago #

    Hmm, dunno. The rewrite rules should do the trick.. Can you think of any other reason why it wouldn't be working? Anything else you've changed regarding WP?

  14. stonegauge
    Member
    Posted 9 years ago #

    Nothing else has changed. I imported originall a few days ago from MT.... I've made several entries since that import. I have the MT redirect PHP script installed. It hasn't been workign because of the permalink structure being blank. so today (just a little whiel ago) I changed the structure to the default structure that is given in the permalink page ont eh Administration page.

  15. Doraemon
    Member
    Posted 9 years ago #

    Hmm... I really don't know why it wouldn't be working. I followed the same steps I gave you to set up my permalinks ( check out my site ) and it works fine.

  16. stonegauge
    Member
    Posted 9 years ago #

    Could it be my host? I'm on Dreamhost which has basically everything a guy could want. I didn't have php-cgi working...
    I should look into mod-rewrite if I need it installed

  17. Doraemon
    Member
    Posted 9 years ago #

    I suppose your host could limit whether you could use a .htaccess file or not. But I don't see why they would. I suppose that would be worth finding out..? The rewrite should really do the trick, that's what allows you to use these virtual directories.. :-/

  18. stonegauge
    Member
    Posted 9 years ago #

    Dreamhost wouldn't limit HTAccess (though I have to admit - I'm having a problem setting up another .htaccess file to limit hotlinking on another directory). I really wouldn't be surprised if it's somethign with mod-rewrite, but I'm pretty sure other WP users are on Dreamhost and not having problems.
    Maybe I just suck? :p

  19. Doraemon
    Member
    Posted 9 years ago #

    You don't suck, lol, believe me, I had trouble getting this to work at first myself- this feature is not plug-n-play. ;-) Look into the mod-rewrite stuff, let me know what you find out.

  20. stonegauge
    Member
    Posted 9 years ago #

    yeah, I'm checkign with dreamhost's forums -- unfortunately (and strangely seeing they are charging now) most people are looking for MT information.
    I will keep you posted.

  21. Doraemon
    Member
    Posted 9 years ago #

    * shudders * MT was fun until they started the whole 'you pay us or die' thing... Mkay, I'll check back regularly.

  22. stonegauge
    Member
    Posted 9 years ago #

    I still use MT on one of my blogs (www.boltsmag.com ) but I also have an install of WP on that site that I will fix up / reconfigure once I get all these bugs out of my private blog...

  23. stonegauge
    Member
    Posted 9 years ago #

    just FYI -- someone did a total walkthrough for installing wordpress on my hosting company.
    There is no mention of this problem however --
    http://www.wombatnation.com/misc/installWordPressDreamHost.html
    Maybe I should try a total re-install? I mean, maybe I botched up somewhere by trying to change the structure after importing entries and what not?

  24. stonegauge
    Member
    Posted 9 years ago #

    blah, I modified the .htaccess file today and the entire site stopped working. CSS wouldn't be read in the WP directory, you couldn't use the admin control panel, etc.
    Had to remove the .htaccess file all together to get thing sworking again.

  25. Doraemon
    Member
    Posted 9 years ago #

    Humm... You need that .htaccess file in order to get the clean URIs working. I find it really strange that it's not working. You file doesn't contain any weird header information right? In other words, it was plain text?

  26. Doraemon
    Member
    Posted 9 years ago #

    Why not do this: install WP again in a new directory, just call it test or something and try to get the .htaccess file working there.

  27. stonegauge
    Member
    Posted 9 years ago #

    sounds like a plan.

  28. stonegauge
    Member
    Posted 9 years ago #

    "You appear to already have WordPress installed. If you would like to reinstall please clear your old database files first."
    This is so frustrating.
    I have a few hundred blog entries from MT that haven't been converted in search engines to WP because the virtual addresses don't work.... So I'm still getting comments on MT blog entries instead of WP Entries. It's so FRUSTRATING.

  29. stonegauge
    Member
    Posted 9 years ago #

    and yes, it was plain text in the file... it was a notepad file saved as .htaccess

  30. Doraemon
    Member
    Posted 9 years ago #

    Hmm, I'm sorry it isn't working... That's very frustrating. :-(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.