Redirection Problem RewriteCond RewriteRule


(Celil Çağlar ÖzlÜ) #1

Hello. I have a website forum.medikalbulut.org with lastest [v2.0.0.beta3 +12] Discourse version on Digitalocean.

forum.medikalbulut.org I am trying to move that subdomain to http://medikalbulut.org

image

How can I redirect all URLs to new domain? I search a lot but I cant find a solution.

For example I found a code for Apache web server. How can I use that htaccess code as below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^forum\.medikalbulut\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.forum\.medikalbulut\.org$
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ "https\:\/\/medikalbulut\.org\/$1" [R=301,L]

I mean, when click these kind of all old subdomain https://forum.medikalbulut.org/c/evde-bakilan-hastalar I want to redirect to new domain automatically https://medikalbulut.org/c/evde-bakilan-hastalar.

Can you help? Thank you.


(Celil Çağlar ÖzlÜ) #2

I solve the problem with https://www.cloudflare.com/ Page Rules

https://forum.medikalbulut.org/ > https://medikalbulut.org/