I need to do permament redirect from clients old site to new one, redirection is from hissite.eu to newsite.com, same hosting but other domains. Now, he wants to still have access to his old site via some subdomain which would not be problem if i could make it work, but old site was badly made with custom CMS, lots of hardcoding and it just does not work if i move it to any directory.
So my question is if i make permament redirection from oldsite.eu to newsite.com , how can i provide him with access to his old site ? Is it possible somehow to not redirect if he types ip address instead of domain, but i suppose again administration panel wouldnt work. Is it possible to do redirection on everyone except specific ip maybe ?
Updating with current htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Rewriterule ^index$ index.php [L]
Rewriterule ^login$ login.php [L]
Rewriterule ^register$ register.php [L]
Rewriterule ^classified_new$ classified_new.php [L]
Rewriterule ^account_classifieds$ account_classifieds.php [L]
Rewriterule ^account_classifieds_manage$ account_classifieds_manage.php [L]
Rewriterule ^account_confirm$ account_confirm.php [L]
Rewriterule ^account_details$ account_details.php [L]
Rewriterule ^account_invoice_browse$ account_invoice_browse.php [L]
Rewriterule ^account_invoice_details$ account_invoice_details.php [L]
Rewriterule ^account_main$ account_main.php [L]
Rewriterule ^account_messages$ account_messages.php [L]
Rewriterule ^account_profile$ account_profile.php [L]
Rewriterule ^ajax_request$ ajax_request.php [L]
Rewriterule ^classified_browse$ classified_browse.php [L]
Rewriterule ^classified_details$ classified_details.php [L]
Rewriterule ^classified_new_form$ classified_new_form.php [L]
Rewriterule ^classified_new_premium$ classified_new_premium.php [L]
Rewriterule ^classified_payment$ classified_payment.php [L]
Rewriterule ^classified_new_confirmation$ classified_new_confirmation.php [L]
Rewriterule ^classified_payment_process$ classified_payment_process.php [L]
Rewriterule ^classified_payment_response$ classified_payment_response.php [L]
Rewriterule ^classifieds_json$ classifieds_json.php [L]
Rewriterule ^convert$ convert.php [L]
Rewriterule ^help$ help.php [L]
Rewriterule ^login_process$ login_process.php [L]
Rewriterule ^search_advanced$ search_advanced.php [L]
Rewriterule ^verification_image$ verification_image.php [L]
#search result
Rewriterule ^search/(.*)$ search_results.php?q=$1 [L]
#classified detail
Rewriterule ^classified/(.*)$ classified_details.php?id=$1 [L]
</IfModule>
It is possible to redirect all but a given IP, you can add a condition to your redirect for example:
For multiple IP's:
Or if the IPs have the same block 192.168.0.1, 192.168.0.2, 192.168.0.3:
Change
xxx\.xxx\.xxx\.xxx
to your client IP.However this would give you a few issues, for instance:
you client could have cached the redirect already, so you would need to ask him to use a different browser temporary or clear his cache (which doesn't always work).
If you have deleted the old rules it possible had on the .htaccess it would not work as expected.
if your client have dynamic IP you would need to change that every time he tries to access it.
There is probably more but this are the most common.