WordPress File and Another Extra Folders

I need to import a Huge website of over 3000 pages
the old content have image or pdf resources everywhere and over 120 static pages.

so some resource can be in /im/foldername/anotherfolder/ others can be /foldername/ obviously I can’t rewrite every single url so I have all folders that contains resources sitting inside the same wordpress directory

Read More
/root/
    /wp-admin/
    /wp-content/
    /wp-includes/
    /im/
    /video/
    /about/
    /pdfs/
    /education/

Here is an example of the the site folders.. the resources will have their old paths but I do not want the path www.example.com/education/ to end up in the folder, but instead actually go to the wordpress.

would I have to put a htaccess on every folder or something? how would I approach this problem?

Related posts

1 comment

  1. This is basically a bad decision for structure . and it is bad on many levels .
    In WordPress, you will want all the files that do not belong to CORE to reside in one folder, and one only, and that is the wp-content .

    Any other structure might look easier for you to implement , but it is almost guaranteed to create more problems in the future , including security problems …
    Further more , if you will make new uploads in that site , you will have duplicate areas with external files .

    What you need is to put all those folders inside wp-content and then just change the relative URL .

    You did not mention how the URL´s are coded , are they in a special table or part of posts , or just coded in theme , but anyhow , there are several things you can do .

    If your urls are coded in the them use wp_upload_dir() or wp_content_url() or any other related directory structure functions ( see related at bottom on linked codex pages ) . Using this let you easily control the URLs

    $mydir = wp_upload_dir() . '/my_dir/video/'// etc.. etc..
    

    If your Urls are in DB , or posts for example , you can do something like this :

    UPDATE wp_newsite_posts SET post_content = replace(post_content, 'old_path/multi', 'wp-content/etc/etc/');
    

    Of course that you will first need to decide where and how you are using those .

    Another thing you could do would be to change the upload_dir constants in wp-config

    define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/somedir');
    define('WP_CONTENT_URL', 'http://example.com/somedir');
    

    This method is not really reccomended if you do not know or fully understand what you are doing . more here

    Now , because your question lacks in specific , i might not have understood it – but it is more likely that either :

    1. You are looking for the easy way ( != the correct way )
    2. you do not fully understand how wordpress process attachments and
      what they are .
    3. you are not planning of using wordpress as a cms , no updating of
      files or new content ( in which case it is not so logic to use it in
      the first place )

Comments are closed.