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 127 posted 4 years ago by apphp-snippets
Statt mit .htaccess kann eine 301-Weiterleitung auch über php erfolgen
0 110 posted 5 years ago by ulfinger
[ Yii Framework ] Use this to redirect to previous page or last request URL
0 81 posted 6 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 87 posted 7 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 100 posted 7 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 96 posted 8 years ago by FatFolderDesigner
PHP 301 redirect code for giving a page a 301 permanently moved code
0 81 posted 8 years ago by bigroadtrip
Removes WWW from the current URL, if exists.
1 73 posted 8 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 79 posted 8 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 73 posted 8 years ago by adambundy
0 101 posted 8 years ago by sybrex
Prevent direct access to php file (Prevenir acesso direto ao arquivo php)
0 73 posted 8 years ago by cdohost
0 63 posted 9 years ago by jacksaidwhat
0 77 posted 9 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 58 posted 9 years ago by prwhitehead
0 51 posted 9 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 166 posted 9 years ago by beneberle
Add this in the functions.php file, in your Wordpress theme.
0 60 posted 9 years ago by ddavidd
A blank search in wordpress returns all the posts, which could be taken as duplicate content if that got indexed.
0 75 posted 9 years ago by baires
0 85 posted 9 years ago by sandrews_06
This code wil 301 redirect non-www URLs to the www URL
0 53 posted 9 years ago by r4b87
Hacer una redireccion permanente
2 80 posted 9 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 74 posted 10 years ago by redhatmatt
1 42 posted 10 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 63 posted 10 years ago by scopefragger
Just a function for correct redirecting *UPD1* header added for Google Chrome
0 61 posted 10 years ago by kirik
0 68 posted 11 years ago by splotchy
« Prev 1 2