![]() |
Quick .htaccess redirect question
How do you redirect for example:
domain.com/fat-boy/wicked to anotherurl.com/fat-boy-paradise Using .htaccess with the rediect happening after 10 seconds Thanks |
i don't think you have a delay-option in htaccess... I'm not a guru, but i've never heared from such a thing...
Maybe you could use your html-headers for this: <meta http-equiv="refresh" content="10; url=http://example.com/"> This way, you can show your original page, and it will automatically foreward after 10 seconds or place a code like this in your php-code: <?php sleep(10); header('Location: http://www.example.com/'); ?> This second option (including in php) might need some tweaking, since it's possible the header has to be sent before any other data is sent to the browser... (actually, i'm pretty sure of this) |
Yeah the problem is I just want to redirect selected pages of a wordpress blog to an external url.
I did think about meta redirects but this would affect it sitewide wouldn't it. If I went down the .php could I just not call the php from anywhere within the page or does it need to be in the header. I'm sure there must be an easier way, a plugin or something. |
Code:
Redirect permanent /path http://man-in-the-middle.com/meta-refresh-redirector-page.html?1 man-in-the-middle.com/meta-refresh-redirector-page has the 10 seconds delay. (Or, use a JavaScript on the wordpress pages only redirecting for that referring page ...) |
Thanks I found a plugin after all Quick Page/Post Redirect Plugin
Seems to do the job. |
You need instant 301's and work on the canonical redirects as well. Is it for google or surfers?
|
RewriteEngine on
RedirectMatch /(.*)$ http://www.newdomain.com Just did this for a client. :2 cents: Edit: Oh I missed that 10 sec comment |
Quote:
|
Quote:
In case anybody ever finds this post, and wants to use php instead of a plugin, the anser to your question is: the header location has to be set before any other data is sent to the users browser (if i remember correctly)... In other words, you can actually make a database-query, use classes and functions,... and depending on the outcome of your querys and calculations print the "header('location" or not. As long as nothing is sent to the browser during the execution of your code.... So it wouldn't be wise to use this line in the <body>-section ;-) |
Quote:
|
All times are GMT -7. The time now is 10:43 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123