0

I currently have a rewrite rule that rewrites *.domain.com to www.domain.com (except for blog.domain.com)

RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com$ [NC]

RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]

I want to rewrite all my URLs from a subdomain to the root domain while keeping page name , adding the ".html" extension, and adding the [301] perm tag:

blog.domain.com/my-first-link  -->  www.domain.com/blog/my-first-link.html 
blog.domain.com/my-second-link -->  www.domain.com/blog/my-second-link.html

1 Answer 1

1
RewriteEngine on
RewriteRule ^(.*) http://www.domain.com/blog/$1.html [R=301,L]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.