Maintain HTTP Link

I configured some redirects on the Apache server. They look like this:

Redirect / Name / Register / login.html

My question is ... is there anyway to keep the HTTP referrer through this redirect? It would seem that by default Apache discards information. I would really like to see after the redirect:

http://the.orginalurl.com/Name/register

Anyone if possible? If not, thoughts on an alternative.

Thank you very much neil

+3
source share
5 answers

Redirectthe referrer will not save because the browser has sent 301 and a new address to open. From the manual :

Redirect URL- , .

mod_rewrite ( ) (.. ) . mod_rewrite GET , .

+6

.

+1

, , . "" "" .

1.

302 , (. Firebug "persist" ):

RewriteCond %{REQUEST_URI} !/index.html
RewriteRule ^(.*)$ /index.html [R=302,L]

2.

302, , :

RewriteCond %{REQUEST_URI} !/index.html
RewriteRule ^(.*)$ /index.html [L]

, - "page.html" , "index.html" "page.html" , URL- "page.html"

..... ... .

The main difference between “RewriteRule” and “Alias” in my particular case is that you can set the rewrite inside .htaccess, while “Alias” isn’t ... so you can’t always use Alias ​​...

0
source

Source: https://habr.com/ru/post/1728646/


All Articles