homepage Welcome to WebmasterWorld Guest from 54.227.34.0
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
Using wordpress as index.html from a sub-folder
Gemini23

5+ Year Member



 
Msg#: 4645650 posted 1:40 am on Feb 16, 2014 (gmt 0)

I have a Wordpress installation that is in a sub-folder on my website which all works fine.

However, having re-designed my website recently I would like to use the Wordpress content on my index.html which currently has the content provided by uploading via ftp Dreamweaver created content.

Is there a way I can use Wordpress content in a subfolder say at greenwidget.com/wordpress (which is where the current 'home' page of the wordpress installation displays)

to display on greenwdget.com (ie at the index.html)

is it possible to do this without moving across the whole wordpress installation which would cause a time-consuming back-link problem... (yes they could all be redirect but I have many hundred posts)

 

aakk9999

WebmasterWorld Administrator 5+ Year Member



 
Msg#: 4645650 posted 1:49 am on Feb 16, 2014 (gmt 0)

What is currently on your home page (domain root) and what else do you have on the site apart from Wordpress that is installed in a folder?

Or is your site now only in Wordpress? If not, what would happen to other pages when you have Wordpress in domain root?

I am asking this because if you move (unfortunately, as far as I know, almost certainly re-install) Wordpress to be in the domain root, then whatever other content is shown for the domain root will not be be there any more.

In which case the wordpress "home" page would be index.php (not index.html) which would be redirected to domain root and when domain root is requested, it would be internally rewritten to index.php

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 4:26 am on Feb 16, 2014 (gmt 0)

assuming you are on an apache installation you could do this using mod_rewrite.
you would internally rewrite requests for the root directory to the wordpress script url you want to serve.
any direct requests for http://www.example.com/index.html or the wordpress url you are using should be externally redirected using a 301 status code to the document root (http://www.example.com/)

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 12:10 pm on Feb 16, 2014 (gmt 0)

Hm....

At the moment (or previously) website was built using Dreamweaver... and 'main' content uploaded to root directory and other folders... Wordpress is in its own folder.
Now restructuring and using the Wordpress installation for main website content... content in other folders and images etc in root is 'archive' material and at the moment I am not entirely sure of its value... in terms of traffic... (which is probably the bottom line) next to nothing...

in a nutshell.. ideally I would like to keep what is in root but may have to re-think...

Ideal scenario is to have main website content in sub-folder with ONE of the pages generated by the Wordpress in that sub-folder redirected to show content in the index.html..

further thought needed.... and re-reading what phranque has suggested...

I am currently re-directing from the index.html to a page in the wordpress folder using a 302 - AND I do still have content on the index.html (that I don't need) - do I remove that content and 301 and never have the index.html display...

lorax

WebmasterWorld Administrator lorax us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4645650 posted 12:38 pm on Feb 16, 2014 (gmt 0)

IMHO, the best way to approach this is to deal with the issue of moving now and fix what needs to be fixed. Otherwise the issue of backlinks and redirects will grow. Bite the bullet and move WordPress to the top level.

The existing HTML content can still be linked to and will work fine. Then, if you wish, you can port that content as you have time and add the redirects you need. I use Redirection plugin for this. Very handy. [wordpress.org...]

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 12:43 pm on Feb 16, 2014 (gmt 0)

I am currently re-directing from the index.html to a page in the wordpress folder using a 302

take the [R] flag off that RewriteRule and move the ruleset after the hostname canonicalization redirect.

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 12:56 pm on Feb 16, 2014 (gmt 0)

I have already previusly moved the wordpress install... and now kicking myself for not moving it to the root... #hindsight...

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 1:00 pm on Feb 16, 2014 (gmt 0)

A bit heavy handed and messy.. I could add a second wordpress install into the root and using rss feed the url at index.html

I don't think this is an option... probably wipe everyting from root anyway...

phranque may well be the simplest and easiest option...

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 1:50 pm on Feb 16, 2014 (gmt 0)

Two thoughts as to the way forward - apart from moving the complete Wordpress installation etc... and adding redirects ...

1. simple 301 redirect from index.html to subfolder url... is there any negative aspect in terms of seo of not having the root domain ever shown in serps?

2. Would it be possible to have a CNAME pointing from index.html to subfolder url? leaving the index.html to be displayed but not the subfolder url...

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 2:14 pm on Feb 16, 2014 (gmt 0)

final question..

re 301 redirect... should I submit index.html for removal in WMT? or just remove the content from the url? or do both...

can/should a canonical be added to index.html as well as a 301?

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 3:03 pm on Feb 16, 2014 (gmt 0)

simple 301 redirect from index.html to subfolder url... is there any negative aspect in terms of seo of not having the root domain ever shown in serps?

in most cases i've seen where the server redirects away from the root domain google assumes there is a technical issue and indexes the redirected content at the root directory.

what you really want to avoid is encouraging others to link to your wordpress url instead of the home page url.
this will be a problem for you later when you correct your technical deficiency.

it's also a signal of poor technical quality when you link internally to the home page url and then redirect to another url.
if you instead link internally to the wordpress url using "Home" anchor text you will be giving all kinds of confusing signals.
i suppose you could fix that with a link rel canonical element referring to the home page url.

i would just do the proper internal rewrite/external redirect two-step or move the blog to the root.

Would it be possible to have a CNAME pointing from index.html to subfolder url? leaving the index.html to be displayed but not the subfolder url...

CNAME is about resolving the IP address of a hostname so that the http connection can be made and the url path doesn't come into play until the http request is made.

re 301 redirect... should I submit index.html for removal in WMT? or just remove the content from the url? or do both...

can/should a canonical be added to index.html as well as a 301?

any requests for index.html should simply be 301 redirected to the directory root url (trailing slash) and at that point the existence or content of the index.html file is irrelevant from a web perspective.

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 3:09 pm on Feb 16, 2014 (gmt 0)

Thanks for your time phranque...

Sorry for being stupid but can you clarify what you mean by
"proper internal rewrite/external redirect two-step"

A downside of moving the wordpress installation is that I have 800+ posts.. and with many backlinks to that content... meaning a large amount of redirects...

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 3:12 pm on Feb 16, 2014 (gmt 0)

the "two-step" is described in my first post in this thread and the technical details are covered in hundreds or thousands of Apache forum threads.

also note i added to my response above, answering another question after you replied.

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 3:14 pm on Feb 16, 2014 (gmt 0)

A downside of moving the wordpress installation is that I have 800+ posts.. and with many backlinks to that content... meaning a large amount of redirects...

it still seems to me like my first answer is what you should do in this case.

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 3:21 pm on Feb 16, 2014 (gmt 0)

Thanks phranque...

"internally rewrite requests for the root directory to the wordpress script url you want to serve."

doesn't the 301 cover that?

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4645650 posted 3:26 pm on Feb 16, 2014 (gmt 0)

if you 301 to the wordpress url then you have moved the home page to a different url and the user agent makes a new request.
if you internally rewrite to the wordpress url, no additional request is made by the browser and the external url is still the home page (http://www/example.com/)

Gemini23

5+ Year Member



 
Msg#: 4645650 posted 3:31 pm on Feb 16, 2014 (gmt 0)

Thank you

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved