Forum Moderators: phranque

Message Too Old, No Replies

Moving complete site: 301 redirection and front page change

         

simonvlc

12:00 am on Sep 13, 2007 (gmt 0)

10+ Year Member



Hi there ;).

I need to insert a front page in one of my larger sites, so my site is going to need a change in the domain.

From serving the content in:

http://example.org

to

http://example.org/en

So my initial plan is to redirect all the site through a 301 redirection, and after a couple of months remove the redirection from the frontpage to insert one.

The problem is, after that 2 months, I suppose that is interesting to maintain the 301 redirect from the interior pages (I donīt want to lose links to articles from other sites). So...

Can I remove the redirection only if the request is for the top path of the domain? (example.org but not example.org/blah)

Any help will be greatly appreciated ;). Thanks in advance, Simon.

jdMorgan

2:47 am on Sep 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why do you feel you need to change the URLs? You can use content-negotiation [httpd.apache.org] to make a multilingual site completely transparent to the users if you like, and no URL changes are required.

Changing all of your URLs risks your pages' rankings and therefore, your traffic and/or revenue. It is not to be done without considering all the alternatives...

Jim

simonvlc

3:18 am on Sep 13, 2007 (gmt 0)

10+ Year Member



Hi Jim,

thanks for your answer. Is not a problem of language selection. I need to put that front page due to legal concerns.

Thanks anyway, Simon ;).

vincevincevince

3:54 am on Sep 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd want to move whatever is at /en to the index page, and then redirect 301 from /en to my index page. Whatever it is you need to remove from your current index page - surely you can just remove it and replace it with something else in the same location?

jdMorgan

4:46 am on Sep 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's important before we start offering coding advice to make sure that we are fixing the right problem. Otherwise, someone may spend a lot of time to post a complete and correct solution to a problem -- but not the problem that you need to solve.

I think that all you want to do is something like this:


Requested URL .............. Serve content from

example.com/ ............... example.com/en/
example.com/blah ........... example.com/blah
example.com/new-index.html . example.com/old-index-page.html

Is that correct?

Jim

simonvlc

10:47 am on Sep 13, 2007 (gmt 0)

10+ Year Member



Hi Jim,

basically I donīt want to lose the internal links with the change. So.

example.org/[index.php] > example.org/[new_front_page]
example.org/[any_other_url_here] > example.org/es/[any_other_url_here]

Thanks for all, Simon.

jdMorgan

2:52 pm on Sep 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



example.org/[index.php] > example.org/[new_front_page]
example.org/[any_other_url_here] > example.org/es/[any_other_url_here]

 RewriteRule ^(index\.php)?$ /new_front_page.php [L]
#
RewriteCond $1 !^new_front_page\.php$
RewriteCond $1 !^es/
RewriteRule ^(.+)$ /es/$1 [L]

This leaves the URLs unchanged, and simply gets the content for those URLs from a different filepath.

Jim

[edited by: jdMorgan at 2:52 pm (utc) on Sep. 13, 2007]

simonvlc

2:03 am on Sep 14, 2007 (gmt 0)

10+ Year Member



Thanks a lot Jim, that worked perfectly ;).

Cheers, Simon.