Redirect Code Needed.
-
Hi,
Please help me redirect the following pages in htaccess.
https://www.mydomain.com/FolderA/FolderB/number-of-pages.html to
**https://www.mydomain.com/FolderA/FolderC/FolderB/number-of-pages.html **
I want to redirect atleast 50 pages like this.
Please help
Thanks
-
Hi Kashif,
Following this structure should get it done.
RewriteRule ^subdirectory/(.*)$ /anotherdirectory/$1 [R=301,NC,L]
For your example it would be like
RewriteRule ^FolderA/FolderB/(.*)$ /FolderA/FolderC/FolderB/$1 [R=301,NC,L]
For less then 100 redirects it "may" also be prudent to do them individually. I say this because it makes it very obvious what is going on if you ever need to edit it again. I would use Excel or OpenOffice to create a spreadsheet then just concatenate the cells together, following this example;
Redirect 301 /path/to-old-url https://www.mydomain.com/path/to-new-url
Ref site: http://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/
Hope this helps,
Don
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
-
301 redirects
I am in the process of truncating many of the URLs using a plugin installed on Wordpress. The question is does google penalize or have issues with too many 301 redirects on your site. I have many many products I want to do this with. I thought I read somewhere that 301 redirects should be held to a minimum. Would appreciate any assistance
On-Page Optimization | | xinar0 -
My home page URL http://seadwellers.com/ redirects to http://www.seadwellers.com/. Is this a problem?
"The URL http://seadwellers.com/ redirects to http://www.seadwellers.com/. Do you want to crawl http://www.seadwellers.com/ instead?" I was given this when I tried to crawl my home page using MOZ software. I was not aware of this, do not know if it could be a problem concerning any aspect of SEO, etc? :
On-Page Optimization | | sdwellers0 -
Duplicate meta data for 301 redirected items
Google webmaster tools tells me that I have duplicate title tags for two items. They have the same product ID. When there is a change in SEO URL, the system does an automatic 301 redirect of the first item towards the second item, like in the example below:
On-Page Optimization | | Madlena
22"x28" White Foam Board School Project Kit|Geographics.com
/p48998/foam-board-school-project-kit-22-x-28/product_info.html /p48998/white-foam-board-school-project-kit/product_info.html What are we doing wrong that Google asks for different meta data for a 301 redirect? Thanks!0 -
301 Redirect to product page or category?
We manage an ecommerce website that sells health products. A few products have now been discontinued. I’m just wondering what would be the best practice in this case. Should we 301 redirect to a similar product or to a similar category page? ANY HELP IS GREATLY APPRECIATED!
On-Page Optimization | | odegi0 -
Disappearing Rel=Canonical Code
Hi, I've been getting a lot of rel=canonical warnings from seomoz. I went into the original pages and pasted in plain text the following code: link rel="canonical" href="http://www.example.com/blog/my-awesome-blog-post"< (the > are reversed). After a few crawls I couldn't see any effect from posting the code. When I went and checked again, it didn't stay in the wysiwyg editor. It disappeared! We are using Drupal 6. Could someone tell me what code I should be pasting? Thanks!
On-Page Optimization | | OTSEO0 -
Need to hire an SEO consultant to fix my website
Just started using SEOmoz and discovered lots of issues with my site. Need some help. Obviously the person could access my SEOmoz account and make sense of all that is needed. Then either go to my website and fix or tell me what to do. Thanks, Scott
On-Page Optimization | | ecoscott0 -
Temporary Redirects
On my crawl report from SEOmoz, I have a lot of Temporary Redirects listed. The referring site is a product category page, but the URL listed is part of a shopping cart. For example: | http://www.adagiowaterfeatures.com/cart.php?action=add&product_id=496 | Tested true for a temporary redirect referred by this url: | http://www.adagiowaterfeatures.com/categories.php?category=Free-Standing-Water-Features/Harmony-River-Collection | Why does this occur and what can I do about it?
On-Page Optimization | | AdagioWaterFeatures0 -
Do I need a Meta description for every page?
HI Guys, We have just developed a new website and I'm looking to add meta descriptions with relevant key words to the pages . As the site has over 80 pages it is quite an undertaking and i was wandering if pages, such as the shopping cart and FAQ's etc, need meta descriptions as well? Thanks in advance : ) Pete
On-Page Optimization | | dawsonski0