Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged redirect



« Prev 1 2
This example shows you how to create redirection o another directory. It may be useful, for example, when you have a project, placed in sub-directory.
0 851 posted 8 years ago by apphp-snippets
Statt mit .htaccess kann eine 301-Weiterleitung auch über php erfolgen
0 771 posted 9 years ago by ulfinger
[ Yii Framework ] Use this to redirect to previous page or last request URL
0 725 posted 10 years ago by tucq88
Sends the user to a different Drupal page. This issues an on-site HTTP redirect. The function makes sure the redirected URL is formatted correctly.
0 587 posted 11 years ago by dilios
I needed away to redirect to a custom BP component upon login for users and this works great. Add this to your functions file. If you are the admin, it will redirect you to the wp-admin.
0 12657 posted 11 years ago by dnnsldr
This needs to be run on an action, or at least I wanted able to get it to run outside of an action, I suggest template_redirect. More information at the link.
0 664 posted 12 years ago by FatFolderDesigner
PHP 301 redirect code for giving a page a 301 permanently moved code
0 547 posted 12 years ago by bigroadtrip
Removes WWW from the current URL, if exists.
1 610 posted 12 years ago by thewickedchemist
Issues a check to see if the "www" is included, if not, forces "www" to be appended to the URL in question.
1 604 posted 12 years ago by thewickedchemist
Place at the top of your header.php to redirect visitors who are not logged-in to the Wordpress admin. I use this to redirect to a simple HTML 'coming soon' page while sites are in development.
1 669 posted 12 years ago by adambundy
0 909 posted 12 years ago by sybrex
Prevent direct access to php file (Prevenir acesso direto ao arquivo php)
0 674 posted 12 years ago by cdohost
0 572 posted 12 years ago by jacksaidwhat
0 739 posted 12 years ago by kreatific
If your page has already sent headers to the browser you cant redirect with headers('Location:' . $url); But you can use the following:
0 481 posted 13 years ago by prwhitehead
0 472 posted 13 years ago by nosmk
Though an old post, this is my solution that's been pieced together from various comments on the article linked above.
1 1104 posted 13 years ago by beneberle
Add this in the functions.php file, in your Wordpress theme.
0 857 posted 13 years ago by ddavidd
0 745 posted 13 years ago by jaredyeo
A blank search in wordpress returns all the posts, which could be taken as duplicate content if that got indexed.
0 608 posted 13 years ago by baires
0 651 posted 13 years ago by sandrews_06
This code wil 301 redirect non-www URLs to the www URL
0 491 posted 13 years ago by r4b87
Hacer una redireccion permanente
2 618 posted 13 years ago by jrobinsonc
on node/add/save redirect your to a url of your choice in Drupal 6 in your own custom module. (in this my module name is qctpmm, it's simply the content type of page and it's redirecting to user.)
0 615 posted 13 years ago by redhatmatt
1 460 posted 14 years ago by phpleo
Sometimes you just need to mask a script or reject a user from a page this can be done effortlessly using a single line of code. Header location will allow you to redirect a user quickly and without them having any control over the action. A good...
1 571 posted 14 years ago by scopefragger
Just a function for correct redirecting *UPD1* header added for Google Chrome
0 491 posted 14 years ago by kirik
0 439 posted 14 years ago by splotchy
« Prev 1 2