K
K
kiril90112017-10-28 14:53:39
PHP
kiril9011, 2017-10-28 14:53:39

Redirect from folder to file?

Hello! I need to redirect from https://profi-promotion.rf/acount to https://profi-promotion.rf/acount/login.php how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Plotnikov, 2017-10-28
@dimap101

Create an index.php file in the /acount folder and write the redirect in it:
1. via JS:

<script>
   document.location.href = '/acount/login.php';
</script>

2. issuing a response code 301 indicating the page for the redirect:
<?php 
header("HTTP/1.1 301 Moved Permanently"); 
header("Location: https://профи-продвижение.рф/acount/login.php"); 
exit(); 
?>

A
Alexander Sisyukin, 2017-10-28
@Caarl

Apache2
Rewrite ^account$ /account/login.php [R=301,L]
Nginx
rewrite ^account$ /account/login.php permanent;
You write what kind of environment you have there, otherwise you need a redirect and that’s the point

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question