WordPress.org

Ready to get started?Download WordPress

Forums

overriding servers directories..thing (3 posts)

  1. efraims
    Member
    Posted 7 years ago #

    (sorry- i dont know how to label this post. any sujestions? :p)

    i just set up permalinks to

    %categories%/%post_name%/

    a common set up. but some category/page names are the same name of directories on the root that WP is intalled on

    so instead of going to the categorie on my wordpress it loads the dir on my server. not only directories but file names as well. any file or dir with the same name as my WP permalink get priority. is there a way i can over ride this action?

    i dont want to go threw the process of renaming all of my categories or directories!

    ---

    example:

    i have a page called clive
    typing:
    http://www.f-ram.net/clive

    doesnt show the page called clive, but the folder called clive. i deleted the index.html file in /clive but that doesnt help. just having the folder- or anyfile with the same name gets priority.

  2. Christopher J. Hradil
    Member
    Posted 7 years ago #

    there are really only three things you can do;

    1) and 2) change categories or directories so there's no conflict.

    3) add something to the permalink url structure /something in order to eliminate the conflict.

    .htaccess and re-writes work by 'ignoring' physical files or directories - that's why they take priority over wp permalinks.

    also, wp permalink/re-write functionality is somewhat 'broken' by default, example, category permalinks contain /category or some other string in order to avoid these conflicts internally, but this breaks in the case where your /cat/post structure matches either some physical files/directory structure or your wp page/subpage structure, example a page named /cat with a sub-page named /page will 'break' permalinks where a category /cat and a post /page for /cat/page.

    on most of our wp installations we have altered the core wp code for re-writes in order to eliminate the extra /category part.

    we just make sure to manage posts and pages so that the permalinks avoid conflicts. the url's are much shorter and cleaner this way.

  3. efraims
    Member
    Posted 7 years ago #

    this is what i got planned

    step 0- back up site

    step 1- move conflicting dirs to an archive (from ./* to ./old/*) with dreamweaver.

    step 1b- have DW scan my site and update all the links
    respectively from /* to /old/*

    step 2- make a copy of all media files originally linking to /* files into one core dir (/media/*) on root

    step 3- use WP search and replace feature and/or manually replace all the medias hyper or reference links from /* to /media* in every post (about 200 post/pages)

    step 3b- look over and review the code in every post and page twice to make sure no little spacer or background is still looking for the original conflicting dirs.

    step 4- kick myself for not worrying about permalinks before making 200 posts/pages!

    (exercises step 4 before each step.)

    what do you guys think?

Topic Closed

This topic has been closed to new replies.

About this Topic