Trouble with permalinks & database backup/import

Discussion in 'PHP' started by johno123, Dec 8, 2008.

  1. #1
    Hi All,

    I am having a problem with my wordpress permalinks settings, after backing up a wordpress site i made with over 300 categories in it. And importing it into another wordpres site. Its not working correctly.

    Yes, I make sure that before backing up, that permalinks are off. I figured that might have been why. But no luck. :confused:


    When i import the sql file i have backed up from the completed site inside phpmyadmin. Everything is a success. But, when i go to the site and click on a category, it takes me to a "page not found" page.

    So i go into wp-admin and change the settings of permalinks to default. Go back and it works fine, but as default ugly permalinks only. For example " sitename.com/?cat=163 "

    None of the other settings for diferrent permalinks work. if you choose something other than default. It always reverts back to " /%Postname%/ "

    Which writes the permalinks url as " sitename.com/category/real-estate/real-estate-for-rent/ ' for example when clicking on a category link. Which are great, but they do not work.


    Any ideas?

    Thanks in advance
     
    johno123, Dec 8, 2008 IP
  2. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #2
    You probably don't have modrewrite turned on. This is a simple thing to do if your new server has it installed. Read more about it here.
     
    fireflyproject, Dec 8, 2008 IP
  3. MooBaa

    MooBaa Peon

    Messages:
    96
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Had a problem changing our permalinks recently from the standard rubbish to /%Postname%/ coulnt get it to work for a few weeks and finally found the problem. The files on the server weren't writeable once I did that and got the hosting company to make sure mod-rewrite was enabled everything was fine. (Mod-rewrite is what allows you to change url names so may be your first port of call)

    Hope this helps
     
    MooBaa, Dec 8, 2008 IP
  4. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Thx 4 your thoughts

    Mod rewrite is definately working, i have other wordpress sites on same hosting and they work fine.

    It is only when i backup the database of the site i want to use on other multiple sites.

    what should be in my htaccess file anyway?


    Its like when i backup the site that has all the categories already setup. It saves into the database files, that only /%postname%/ can be the only user choice. Then when i add it to the new sites database, it will only let that permalink option work.
     
    johno123, Dec 8, 2008 IP
  5. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #5
    sample htaccess
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php [L]
    </IfModule>
    Code (markup):
     
    javaongsan, Dec 8, 2008 IP
  6. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #6
    is that an htaccess for wordpress?

    inside mine says

    # BEGIN WordPress
    # END WordPress
     
    johno123, Dec 8, 2008 IP
  7. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #7
    # denotes comments so its the same
     
    javaongsan, Dec 8, 2008 IP
  8. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #8
    Thx for help so far, but no luck resolving this as of yet..

    I am getting so frustrated trying to figure this out..:mad::mad::mad:

    Can you tell me which part of the db needs to backed up, so it just grabs the categories. No posts or other info..?

    basicially so i can just plug the categories into any wordpress install.

    Maybe i can do it this way..?


    thx again in advance for any help..
     
    johno123, Dec 8, 2008 IP
  9. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #9
    wp_terms
    wp_term_taxonomy
     
    javaongsan, Dec 9, 2008 IP
  10. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #10
    Ok, so i have dsicovered that it is a plugin problem that conflicts with wordpress's permalink options. Wordpress permalinks work just fine without the plugin installed. Kinda dumb...

    is there a way to make a htaccess file without using the wordpress permalinks feature? SO i can have pretty permalinks? If so, what would i put in it to make it look like below?

    www.sitename.com/?cat=29

    to look like

    www.sitename.com/category/postname/


    thx all for any help
     
    johno123, Dec 10, 2008 IP
  11. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #11
    i installed the same site on the root instead of the subfolder of my hosting and permalinks worked just fine...grrr..

    so i need to know how to make wordpress know that my site is in a subfolder off my hosting root.. something in the htacces file?

    I am setup like so

    main site(root) permalinks are fine

    >>testersite(subfolder off the root) permalinks not fine.


    hope that makes sense.
    any help would be appreciated.
     
    johno123, Dec 11, 2008 IP
  12. lvtim

    lvtim Well-Known Member

    Messages:
    291
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #12
    Are you using the Robots Meta plugin by any chance?
     
    lvtim, Dec 11, 2008 IP
  13. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #13
    Replace wordpress with your subdirectory name

    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    # END WordPress
    
    Code (markup):
     
    javaongsan, Dec 11, 2008 IP
  14. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #14
    No, the Robots Meta plugin is not used at all.



    i have confirmed that this plugin does not work with wordpress for permalinks correctly. But when I deactivate the plugin, permalinks work just fine.. Go figure..


    I decided to go and take it a step further by installing it on a totally differrent host. And guess what.. Works Just fine with permalinks in place. No htaccess modification or anything. It Just Worked!


    I dont think adding the subfolder to htaccess would work out. Because permalinks work fine on the site when the plugin is deactivated

    Maybe i forgot to mention in the beginning, that the subfolder i am using off teh root has its own domain pointing to it.

    It is not like the root site is sitename.com and the blog is installed at sitename.com/blog/


    Maybe that helps..

    thanks for any replies..
     
    johno123, Dec 11, 2008 IP