0

Would this be a bad idea for any reason? - installing Wordpress in a sub-directory (ie: http:// example.com/wordpress) alongside the current website (ie: http:// example.com) that is not using Wordpress...and still running Wordpress from the root by Giving Wordpress It's Own Directory and using .htaccess to change the Directory Index (so http:// example.com still points to the non-Wordpress website's home page).

This would allow all the content to be added to the Wordpress website and when it's ready to replace the non-Wordpress website, it's just a matter of deleting the non-Wordpress files and re-pointing the Directory Index back to the Wordpress index.php with the .htaccess.

P.S. - this seems like an option for my current project because the non-Wordpress website uses different page names than we will be using with the new Wordpress website, so there will be no conflicts there.

UPDATE: Attempted this and it will not work because Wordpress returns the 404 page when trying to load the non-Wordpress pages (ie: http:// example.com/Non-Wordpress-Page)

2
  • 1
    I don't the issue with approach, however in current form this is a little more opinionated than fact based. Have you tried this setup already? What were your results and issues, if any?
    – Rarst
    Nov 18, 2013 at 21:00
  • Haven't tried yet as I didn't want to attempt it if someone with more WP experience was to suggest it was not a good idea, which was the reason for posting.
    – codeview
    Nov 18, 2013 at 21:37

3 Answers 3

0

This can be done. What you want in your .htaccess is something like

if directory do not exist in root
  change root to the wordpress directory

unfortunately I am not familiar with a way to do such a thing with .htaccess

The other option is to map each possible url directory to the wordress directory, but since url directories in wordpress are created dynamically when you add category, page, new post date and more, it will become hard to maintain the .htaccess. Maybe you will have better luck with special treatment to the current site URLs.

And this all assumes that you will not have conflicts in URLs between the old site and the wordress site.

0

At the moment we do almost (because we don't want any redirections to Wordpress through .htaccess at all at the moment) the same as you want.

Maybe I read/understand totally wrong what you mean.
(if so tell me in comment and I will delete this answer so no one will be confused)

At the moment we have 1 of our non Wordpress sites (which is running for years now) and installed Wordpress in subfolder of the root (public_html/wordpress-foldername).
Both have no connections to/with eachother and outher world does not know/see Wordpress.

As soon we have Wordpress ready to launch for public we will just copy .htaccess and index file to the root. (and leave Wordpress in subfolder ofcourse)

Telling the root index file where Wordpress folder is (after copying it) with this code: require('./your-foldername/wp-blog-header.php'); moving also wp-config.php to the root and it will run as wished.
Moving wp-config.php to the root as soon it goes live and adding define('WP_HOME','http://yoursite.com'); define('WP_SITEURL','http://yoursite.com/wordpress-foldername'); .
(Some bad written plugins could make issue's because wp-config.php is not in the main Wordpress folder but that is already a reason not to use those that plugin)

No conflicts, no issues because Wordpress will act as it should and wanted. (Lot's of ppl have Wordpress in subfolder so it is excact the same, only difference is you work now with it and nobody knows it is in there)

Most hassle could be (will be in our case) redirecting "old url's to new url's" through .htaccess (need to have that part finished before you will launch Wordpress live ofcourse)

We also have at the moment Wordpress Search Engine Visibility OFF. We have taken precautions so no access and visibility for outherworld nor Google to Wordpress. (you could do with .htaccess and/or cPanel or DirectAdmin or other whatever other controllpanel)!

As soon .htaccess is redirecting all files/url's as should it is just a mather of 2 minits to launch, don't forget to tell Wordpress to have Search Engine Visibility enabled as soon it will be launched.Also go once in Back-end and go to General Settings and save once.

I hope this is some information you could use/ are looking for. And if you don't want to risk any, why not trying it out in a sandbox first.

Note:About the possible issue's Mark Kaplun is fearing for, there is non because the active site is not pointing to Wordpress and visa versa, we did this once before and working at this project now also for some weeks and did not have 1 issue. Sorry Mark no offence meant but imho there is/can't be even 1 issue. Only thing which could be a hassle is making a sitemap as long it is in development state so don't even do it at that point.

3
  • Sorry, I didn't see that other one, but it seems you had this question already asked some hours before this one. wordpress.stackexchange.com/questions/123653/… So it is duplicated, just adjust the way of asking and hoping to get more/other information is not the way it should imho!
    – Charles
    Nov 19, 2013 at 10:32
  • Thank you for your answer, Charles. The problem I see with that method though is that all of the pages created would be 1 level too deep once you want to switch the site to the root, ie: yoursite.com/wordpress-foldername/page instead of yoursite.com/page - which I was thinking was why changing the site URL would have to happen right away. And regarding my other question that you linked to, if you read it more carefully you'll see that it is quite different - and I would have been told to start a new topic if I asked in under that other post.
    – codeview
    Nov 19, 2013 at 18:28
  • My mistake, you are absolutely right about 1 level deeper (did not think about it as it would be an issue for you). And probably also about asking it another way they could want you to make a new question. My apologize. It is douable as above but will need some more (other)steps. Not that difficult but knowing what you do would be handy.(playing with your db) It is up to you which way you prefer. That I didn't answer the way by using .htaccess, your way, I have to apologize also, using .htaccess your way is not my league and imho a little obscure.
    – Charles
    Nov 20, 2013 at 7:01
0

As indicated in my UPDATE: Attempted this and it will not work because Wordpress returns the 404 page when trying to load the non-Wordpress pages (ie: http:// example.com/Non-Wordpress-Page).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.