Change name of directory
-
How can I best change the name of a directory on my website (example: http://www.website.com/nameofdirectory/)?
The directory has lots of content included in it which has links from all over my website. I guess I have to adjust those links? How do I easily collect all of the links?
Which is the code I should use in my htacces?
Thank you!
With kind regards,
Dieter -
A 301 is the code returned by your web server, along with the address of the new page. htaccess (mod_rewrite) is the most powerful tool to do this because it uses regular expressions to filter (which, consequently, also makes it more difficult to use).
You don't have to use htaccess, however. Virtually all server-side programming languages (like PHP, .NET, Ruby on Rails, etc) support telling Apache what headers to return. Here's a PHP example
header("HTTP/1.1 301 Moved Permanently");
header("Location:http://www.newsite.com");
exit(); -
You can use a text editor like Notepad++ for it.
-
Is there a software I should use for "Search & Replace"?
-
Download the website and do a search and replace for nameofdirectory to new****nameofdirectory. That should take care of it. Along with that put a 301 in place for any external links going to nameofdirectory. You should be good.
-
I just dont see how I can add a 301 redirect to a page. I thought I could only add it in .htaccess?
How about the pages on my website that link to the old directory?
-
The website itself is static but the directory is a CMS. What would be the best option then?
-
The same principle applies to all rewrites. You can rewrite one page, an entire directory or even your whole site. htaccess is one of Apache's best features and that's why every web server out there offers some version of it.
If I'm still not answering your question then please supply some more details and I can go more in depth.
-
Is your website static or uses some sort of a CMS ? It might be possible to do a search and replace for nameofdirectory or newnameofdirectory and that should work. I would also recommend doing a directory level 301 redirect via .htaccess that will redirect http://www.website.com/nameofdirectory/* to http://www.website.com/new****nameofdirectory/*
//301 Redirect Entire Directory RedirectMatch 301 /nameofdirectory(.*) /newnameofdirectory/$1
-
@ Highland: It is not a page, it is a directory.
-
You need to add a 301 redirect to your new page. This will send a command to your browser (and any bots) to go to the new page. This page describes how to modify your htaccess file.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
SERP result (URL) doesn't change after a 301
A couple of months ago there was a result in Google for our branded search term which wasn't the 'official' URL, actually the result shown in the SERP was www.mycompany-ip.nl. We've applied a 301 redirect of this URL to the 'official' URL which is a subdomain: department.mycompany.nl. From Google the redirect is obviously working, but up until now, I don't see Google replacing the incorrect URL by the correct URL. I am wondering what to do to make the result correct. André
Technical SEO | | ConclusionDigital0 -
HTACESS Redirect Root Domain To Sub-Directory
Hi Guys, I posted on another post here http://moz.com/community/q/site-migration-between-cms-s about an issue I am hleping out on with a client about migrating between Joomla and Wordpress. He wants to keep some of the old links live on the Joomla installation (I have advised that Google won't be able to crawl these) he wants the new wordpress installation to run on www.site.com/customise (a subdirectory) I have researched this and can't see any issues with indexing or page authority as it's just like having an index.php on the end of every URL. So basically if you go to www.site.com it will be redirected to www.site.com/customise. Will there be any issues, will go frown upon this in anway? Kind Regards Neil
Technical SEO | | nezona0 -
Repeating brand name on all subcategory levels
As part consolidating our site navigation, I have an opportunity to change how we name url s on child pages. At present, I think there are 2 problems that could be fixed.
Technical SEO | | stephenfishman
1.As you drill down, the brand name is not part of each url.
2. Also, the urls show abreviations that are not customer friendly. Are these worth changing? I am redirecting pages whether I change the naming or not. Below is my current navigation and below that the changed navigation I am considering. Many thanks to all that look and share their thoughts. Handcrafter --- details -- This is an e-commerce site with on hand products and similar products which are custom ordered from a catalog: Current Navigation Drill Down: /ctgy/brandname.html /ctgy/brandname-onh.html
/ctgy/onhmir.html then the specific products:
/onhmir/30322-onhmir92_741.html
/onhmir/30324-onhmir96_743.html The catalog has more products and so has 1 extra level of child category pages:
ctgy/brandname.html
/ctgy/brandname-cat.html
/ctgy/brandname-catmir.html
/ctgy/design1catmir.html
/ctgy/design2catmir.html then the specific products:
/catmir/30322-catmirhappy.html
/catmir/30324-catmirhappy.html Changed Naming Under Consideration:
On pages above the product page, (category pages) spell out all words and place the brand name in the parent url. The result would be: /ctgy/brandname.html /ctgy/brandname-on-hand.html
/ctgy/brandname-on-hand-mirror.html then the specific products:
/brandname-on-hand-mirror/30322-onh-mir92_741.html
/brandname-on-hand-mirror/30324-on-hand-mir96_743.html The catalog has more products and so has 1 extra level of child category pages: /ctgy/brandname-catalog.html
/ctgy/brandname-catalog-mirror.html
/ctgy/brandname-catalog-mirror-style1.html
ctgy/brandname-catalog-mirror-style2.html then the specific products:
/brandname-catalog-mirror-style1/30322-cat-mirhappy.html
/brandname-catalog-mirror-style1/30324-cat-mirhappy.html0 -
Changed URLs from Upper to Lower Case, and lost page authority should we switch back?
During an overhaul of our site architecture we switched from having capitals in our urls to all lower case, we did the 301's but the page authority is not nearly what it was should we switch back? (new) http://www.usleaseoption.com/rent-to-own/florida vs (old) http://www.usleaseoption.com/rent-to-own/Florida/
Technical SEO | | mjo1360 -
Changing E Commerce platforms
Hey All, Im Olga and new to search engine optimization and web development. I recently changed from O S Commerce to Go daddy Quick shopping Cart. Before on my old site I had a lot of images show up on google searches on the first page in the image section that have recently vanished due to the change. I think that is where the majority of my sales were coming from as I did not really rank for any keyword searches. My old web designer did everything for my old site and told me a year ago he was to busy to help me out anymore and I did not know how to work OS Commerce hence the change to quick shopping cart. Does anyone know how to get images back into google images, or any other beginner strategies to help me rank in google. I have used all of the tools on this program and pretty much got everything figured out only I think the industry I am in is VERY competitive. Would love any advice or help. Thanks, Olga Girls Gone Biker
Technical SEO | | girlsgonebiker0 -
Changing image path of the whole domain
Hi together, we are using a CDN for delivering static images. Due to some changes we want to change the path for images for the whole domain. like: images.example.com/old/var/test.jpg to images.example.com/new/var/test.jpg Does anyone know what could happend to SERPs? (old path will be available) Best regards Steffen
Technical SEO | | steffen_0 -
SEO Benefit/Liability of changing URLs of a 2 year old site
I sell RV Parts online. Our organization is called The ROUTE 66 RV Network, so we brand everything around ROUTE 66. When we launched our store 2 years ago, we launched it with the domain: parts66.com We have a PR of 2, and we have been doing an SEO linkbuilding campaign ever since it has been around. Our primary keyword that we are trying to rank for is RV PARTS We also own the domain: rvparts66.com My question is: Is there a significant benefit to switching our URL to RVPARTS66.COM? Does having our primary keyword a part of our URL give us an SEO benefit? If so, what is the best way to keep any credit we have built for our original domain? We are in the process of a complete site overhaul which will launch in a couple weeks, so if there is ever a time to switch domains, the time is now. Thanks! jc
Technical SEO | | steve-2886180 -
Changing CMS, are there SEO effects?
We want to change our cms from typo3 to CMS made Simple. We have done this already for another site and it effected the rankings. Have you got experience with this? What factors are important for SEO to consider? Is it normal when you change from cms the rankings will drop?
Technical SEO | | PlusPort0