Forum Moderators: phranque

Message Too Old, No Replies

Redirecting help needed w move to WP

I'm moving to WP, have files in root and subdirectory and need help htacces

         

shoreline

10:40 pm on Nov 25, 2009 (gmt 0)

10+ Year Member



I'm converting an old site to Wordpress and need help with permalinks.

Right now, I have a number of files that reside in the root directory, like:
/greengrass.asp
no problem... I also have a large number of files in the following directory:
/lawns/brown-grass.asp

I have my permalinks set so that I get the /greengrass.asp, but what should I do for the /lawns subdirectory?

I could 301 them, but I have so many with great backlinks - as I do with the ones in the main directory.

Is there a way I can do this with the .htaccess beyond what wordpress has there?

Here is what I have for permalinks:
/%postname%.asp

and here is the standard wordpress section from my htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

What I'm trying to accomplish is create posts with the same name and directory structure, but it seems I can only choose one. It would be great if there was a way that I could just edit the filename when editing the post so that it would include the subdirectory...

How should I go about this?

Thanks!

jdMorgan

2:17 pm on Nov 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your structure is limited to only one or two "subdirectories" then consider replacing the "subdirectory slashes" with hyphens and just carry on.

As WP is not and will never be 'perfect' and your requirements may change over time, I strongly suggest that you do not install WP in your root directory; Put it in a subdirectory so that you can easily change to use the 'next big blog program' in 2015, and so you won't have 'collisions' between real filenames and post titles -- For (a somewhat over-simplified) example, with WP in root, you will never be able to post a page with the title of 'robots.txt' because that 'title' exists as a real file, and therefore won't ever be passed to WP. The same would likely be true for titles like "images" and other possible titles that correspond to frequently-used file and directory names.

Jim