express_redirect.js
· 225 B · JavaScript
Sin formato
const express = require('express');
const app = express();
app.get('/oldpage', (req, res) => {
res.redirect('https://www.newpage.com');
});
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
| 1 | const express = require('express'); |
| 2 | const app = express(); |
| 3 | |
| 4 | app.get('/oldpage', (req, res) => { |
| 5 | res.redirect('https://www.newpage.com'); |
| 6 | }); |
| 7 | |
| 8 | app.listen(3000, () => { |
| 9 | console.log('Server is running on port 3000'); |
| 10 | }); |
flask_redirect.py
· 194 B · Python
Sin formato
from flask import Flask, redirect
app = Flask(__name__)
@app.route('/oldpage')
def old_page():
return redirect("https://www.newpage.com")
if __name__ == '__main__':
app.run(port=5000)
| 1 | from flask import Flask, redirect |
| 2 | |
| 3 | app = Flask(__name__) |
| 4 | |
| 5 | @app.route('/oldpage') |
| 6 | def old_page(): |
| 7 | return redirect("https://www.newpage.com") |
| 8 | |
| 9 | if __name__ == '__main__': |
| 10 | app.run(port=5000) |
php_redirect.php
· 61 B · PHP
Sin formato
<?php
header("Location: https://www.newpage.com");
exit();
?>
| 1 | <?php |
| 2 | header("Location: https://www.newpage.com"); |
| 3 | exit(); |
| 4 | ?> |
redirect_page.html
· 305 B · HTML
Sin formato
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="5; url=https://www.newpage.com">
<title>Redirecting...</title>
</head>
<body>
<p>If you are not redirected in 5 seconds, <a href="https://www.newpage.com">click here</a>.</p>
</body>
</html>
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta http-equiv="refresh" content="5; url=https://www.newpage.com"> |
| 6 | <title>Redirecting...</title> |
| 7 | </head> |
| 8 | <body> |
| 9 | <p>If you are not redirected in 5 seconds, <a href="https://www.newpage.com">click here</a>.</p> |
| 10 | </body> |
| 11 | </html> |
redirect_script.html
· 265 B · HTML
Sin formato
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redirecting...</title>
<script type="text/javascript">
window.location.href = "https://www.newpage.com";
</script>
</head>
<body>
<p>Redirecting...</p>
</body>
</html>
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <title>Redirecting...</title> |
| 6 | <script type="text/javascript"> |
| 7 | window.location.href = "https://www.newpage.com"; |
| 8 | </script> |
| 9 | </head> |
| 10 | <body> |
| 11 | <p>Redirecting...</p> |
| 12 | </body> |
| 13 | </html> |
redirect_with_timeout.html
· 407 B · HTML
Sin formato
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Redirecting...</title>
<script type="text/javascript">
setTimeout(function() {
window.location.href = "https://www.newpage.com";
}, 5000); // 5 seconds
</script>
</head>
<body>
<p>If you are not redirected in 5 seconds, <a href="https://www.newpage.com">click here</a>.</p>
</body>
</html>
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <title>Redirecting...</title> |
| 6 | <script type="text/javascript"> |
| 7 | setTimeout(function() { |
| 8 | window.location.href = "https://www.newpage.com"; |
| 9 | }, 5000); // 5 seconds |
| 10 | </script> |
| 11 | </head> |
| 12 | <body> |
| 13 | <p>If you are not redirected in 5 seconds, <a href="https://www.newpage.com">click here</a>.</p> |
| 14 | </body> |
| 15 | </html> |