[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

.htaccess 301 code help

Posted on 2014-08-28
4
Medium Priority
?
211 Views
Last Modified: 2014-08-28
Hi,

Could anyone help me write a piece of .htaccess code.

We currently have a blog hosted as a subdomain and have managed to get it mirrored across to a subfolder for SEO purposes. I now need to write the htaccess code such that ALL PAGES of the blog are 301'd across to the relevant subfolder pages as in the example below:

Current Structure
http://subdomain.domain.com/folder/page/path/

New Structure:
http://www.domain.com/subfolder/folder/page/path/


Thanks for your help
0
Comment
Question by:ChilliSauce
  • 3
4 Comments
 
LVL 18

Accepted Solution

by:
Hube02 earned 2000 total points
ID: 40290117
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ http://www.domain.com/subfolder/$1 [R=301,QSA,L]
0
 
LVL 18

Expert Comment

by:Hube02
ID: 40290124
Forgot, that goes in the root of you subdomain
0
 

Author Comment

by:ChilliSauce
ID: 40290275
Forgot, that goes in the root of you subdomain

Sorry do you mean that the .htaccess file that contains this code should be in the root of the subdomain??

Thanks
0
 
LVL 18

Expert Comment

by:Hube02
ID: 40290307
yes
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question