Forum Moderators: phranque

Message Too Old, No Replies

moving a category and all its contents

         

jojy

1:15 am on Nov 24, 2008 (gmt 0)

10+ Year Member



Hello,
I have categories which are in this format

[mywebsite.com...]
[mywebsite.com...]
[mywebsite.com...]

I want to safely rename catname and this category has page rank 5. Is it good to move all contents by using HTTP 301 .htaccess? If so would you please write one line of mod_rewrite code for me?

Thanks

g1smd

9:05 pm on Nov 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's more than one line of code; both rewrites and redirects are normally involved.

More importantly, do I assume:

1. you want to change the URLs, but leave the files in the same place on the server? or,

2. you want to move the files on the server, but keep the same URLs?

Both are possible, and the question does not make that clear.

jojy

9:38 pm on Nov 24, 2008 (gmt 0)

10+ Year Member



Thanks for the reply. All urls will remain same only category name will be changed. Here is the example I want to change only catname from above urls so all urls will look like this

[mywebsite.com...]
[mywebsite.com...]
[mywebsite.com...]

g1smd

9:41 pm on Nov 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Oh, yes, use a 301 redirect from old URL to new URL.

Also make sure the onsite links point to the new URLs.

Is the folder on the physical server being renamed too? If it is not, then you will also need a rewrite here.

jojy

10:01 pm on Nov 24, 2008 (gmt 0)

10+ Year Member



there is no folder thing all mod_rewrite.. can you tell me mod rewrite rule?
Thanks

jdMorgan

8:05 pm on Nov 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We don't write your code for you here. We'd rather help you do it yourself, so that you end up with code that you understand, and can modify and mantain on your own.

We're also happy when those who have learned something here come back to help others.

Assuming that you already have other working rewrite rules in your root .htaccess file, you might start by testing something like this:


RewriteRule ^categories/[i]old-catname[/i](.*)$ http://www.example.com/categories/[i]new-catname[/i]$1 [R=301,L]

For more information, see the resources cited in our Apache Forum Charter [webmasterworld.com], and review the threads in our Apache Forum Library [webmasterworld.com].

Jim