PDA

View Full Version : SimpleScript WordPress installation into subdirectory w/ .htacess rewrite



jonasholmstrom
05-17-2009, 04:36 AM
I'd like to use SimpeScripts to install WordPress for my main domain.

However, I have several domains hosted in my account I and would like to move the content of my main domain which is currently at:

public_html

to a subfolder like:

public_html/maindomain/

I've tested doing it using these instructions:

.htaccess - How to make a subfolder the main folder for your main domain
http://helpdesk.hostmonster.com/kb/index.php?x=&mod_id=2&id=308

And the rewrite works fine. However, SimpleScript doesn't give me the option to install into the subfolder and specifying the top-level as the URL.

What is boils down to is this:

What I want it to install WordPress into
http://www.maindomain.com/maindomain/
But, using the rewrite make it appear as:
http://www.maindomain.com

It seems to be a no-can-do w/ SimpleScripts. Or has anyone solved this problem?

stamat
05-17-2009, 10:37 AM
I installed WordPress in subfolder of my primary domain via SimpleScripts.
Then I redirected primary domain to that folder via .htaccess file in public_html/, and all worked well.
How Wordpress is installed in subfolder of public_html/ and myprimarydomain.com points to that folder.

I also tried installing in myprimary.com/subfolder when .htaccess redirection was on (to subfolder), and all went well also.
Seems that SimpleScripts do not know about .htaccess files, and that it assumes that yourprimary.com only points at public_html/
So if you install in yourprimary.com/subfolder from SimpleScripts, while .htaccess redirects primary to subfolder, WordPress will be automatically available through yourprimary.com

Regards.

jonasholmstrom
05-17-2009, 11:24 AM
OK. I got it to work as well. In the sense that I got myprimary.com/subfolder to show up as myprimary.com/. But the problem was that all links to posts etc within WordPress points to myprimary.com/subfolder/ and I would like all links to be just (for example) myprimary.com/category/article-name/.
I.e. that darn subfolder becomes part of the URL and I don't want that!

pghcollectibles
05-17-2009, 12:11 PM
the part where it shows the subfolder also gets fixed with the htaccess.

im in a little hurry so i dont have time to search but the rewrite_cond would look to see if /subfolder exists and the rewrite_rule would be something like /subfolder/(*.) /$1

there are a few exaples here that show what i mean. search the forums for htaccess posted by user falcon1986

i wouldnt be supprised if he posts the solution here eventually

stamat
05-17-2009, 12:28 PM
Go to your wp-admin and look for settings link in left-bottom corner.
There you can remove /subfolder from WordPress address (URL) and Blog address (URL) fields.

After I did it, pages on my Wordpress did not have /subfolder part in URLs.
I did have to restart firefox before being able to login again after this change.
Do this only if your primary.com already points to subfolder. If not Wordpress will get confused.

Regards

jonasholmstrom
05-17-2009, 05:02 PM
Stamat,

That solved my problem! Awesome help!