Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Premise:

  • My photography website is www.domain.com and my blog is on www.domain.com/blog.
  • Everything is on self hosted wordpress platform.
  • On my index page I have my photo galleries.
  • I now would like to use a third party service to host my galleries at www.galleries.com/me.

What I would like to achieve:

  • when someone visits www.domain.com it gets redirected 301 to www.galleries.com/me but keeps my domain visible in url address
  • when someone visits www.domain.com/blog everything stays as usual and nothing changes.

What I thought:

  • usa redirect rule PLUS a rewrite rule on my .htaccess

Questions:

  • Is it possible?
  • How can i do it?
  • How does it affects SEO?

I tried to make it as simple as I could :) Thanks

share|improve this question
    
The very definition of a 301 is that the address bar changes. You may be able to get the behavior you want with a reverse-proxy setup (where all connections come to your server, then for certain pages it creates a new connection to galleries.com to fetch the content) - would something like this work for you situation? –  Shane Madden Oct 18 '11 at 15:49
    
Thanks Shane. Sounds like it should work. How can i make it happen? –  Max Oct 18 '11 at 16:01
    
Depends - do you have access to any Apache config files, or just htaccess? –  Shane Madden Oct 18 '11 at 16:12
    
@ShaneMadden htaccess only.. –  Max Oct 18 '11 at 23:28

2 Answers 2

You could try mod_proxy to run a proxy for www.galleries.com/me. Be sure to read the red boxes on the docs page. Also you'll want to check that the service allows this.

Alternatively, you could find a hosted service that allows you to use your own domain (you could use subdomain perhaps e.g. gallery.domain.com) or you could install an FOSS gallery package.

share|improve this answer

Since you've no access to the normal config context, the normal method of just using ProxyPass is of no use.

Try this, in an .htaccess in the site's root:

RewriteEngine On
# Don't redirect for anything in /blog.
RewriteCond %{REQUEST_URI} !^/blog [NC]
# Everything else, proxy to www.galleries.com/me
RewriteRule (.*) http://www.galleries.com/me/$1 [P]
share|improve this answer
    
Doesn't do anything.. white page :( –  Max Oct 20 '11 at 0:06
    
Interesting. Does it redirect you if you turn the [P] to [R]? If that works but [P] doesn't, then you provider might not have mod_proxy loaded in their Apache configuration. –  Shane Madden Oct 20 '11 at 0:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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