Htaccess redirection from old url to new url with parameters [Solved/Closed]

- - Latest reply: ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
- Jul 2, 2016 at 09:21 AM
Hello,
.
via htaccess in need help to redirect from old domain dirty to a clean new domain with parameters.
.
- new domain
- remove blog folder
- add .html at the end of article title
.
Original url:
https://subdomain.myoldsite.org/blog/2016/07/01/article-title

.
New url:
https://subdomain.mynewsite.org/2016/07/01/article-title.html

.
.
Thank you for your helps.
See more 

4 replies

Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1456
0
Thank you
Thank you for sharing! I have a question though, is this a question of how, or a statement of work?
Hi,
sorry, I don't get what you mean.
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1456
0
Thank you
We are not certain of your "scope" of work.

Are you asking how to do this type of task on the service "htaccess"?

"You should avoid using .htaccess files completely if you have access to httpd main server config file".

It's kind of fun to do the impossible! -Walter Elias Disney
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1456
0
Thank you
maybe this works, try this:
Redirect /olddirectory/oldfile.html http://exampleSCR.com/newdirectory/newfile.html

It's kind of fun to do the impossible! -Walter Elias Disney
0
Thank you
Hi,

work for me :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://%1subdomain.mynewsite.org/$1.html [R=301,L]
ac3mark
Posts
13036
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1456 -
Thank you for sharing!