F
F
Foxman3222020-10-20 13:54:37
htaccess
Foxman322, 2020-10-20 13:54:37

How to redirect a file in a directory to another subdomain in .htaccess?

Hello everyone, please help. Need to redirect
https://old.site.com/Gallery2/index.php to https://new.site.com/Gallery2/index.php
I know I need to create a .htaccess file in the folder (Gallery2 directory), but what to write there is a mystery to me.

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-10-20
@Foxman322

FILE /Gallery2/.htaccess

RewriteEngine On

RewriteCond %{HTTP_HOST} ^old\.site\.com$ [NC]
RewriteRule ^index\.php$ https://new.site.com/Gallery2/index.php [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question