redirect

301 redirect everything to new root?

I am trying to do a 301 redirect of everything from an old subdomain to a new. I have a simple .htaccess Redirect 301 / http://www.smartphonesoft.com/ However if I goto the old URL with a subdir, it tries to redirect to the new domain with a subdir and fails. ie http://forum.smartphonesoft.com/reminder/ goes to http://www.smar...

Domain name slash user name redirect to PHP page

Hi, I would like to find a way for users to be able to type their username after my domain name to access their public profile page. For example, if you type youtube.com/username it shows that user's channel page. The resulting page is the same as youtube.com/user/username. So with my website, I have mydomain.example/users/profile.php?na...

Bash script - store stderr in variable

I'm writing a script to backup a database. I have the following line: mysqldump --user=$dbuser --password=$dbpswd \ --host=$host $mysqldb | gzip > $filename I want to assign the stderr to a variable, so that it will send an email to myself letting me know what happened if something goes wrong. I've found solutions to redirect stde...

Detect language and redirect to subdomain on Symfony

Hi, I'm using Symfony 1.2.7. My web is in several languages, each of one is in a subdomain like en.example.com, es.example.com. If the user enters into example.com, I want to redirect him to his language. I also want to have support staging.example.com and redirect to es.staging.example.com and en.staging.example.com so I can test every...

how to stop endless redirect after successful login

My grails app is using Spring Security (Acegi). Users can login on /login. after this is successful it redirects to /. if someone now tries get back to the URL /login the browser says "endless redirect, the request could never be ended". in the login controller, action login which shows the login view there is some code if (isLoggedIn...

setting a url as visited

hello, I have a <a href="my_redirect_page.php?link=mylink">my_text</a> link on my page, and the following line in my_redirect_page.php: header("Location: ".$mylink); but after the redirection, if I click on back in my browser, the "my_text" for the link does not appear as visited (in purple, instead of blue). How do I work arou...

Using header("Location") from a template include file / Process include and save in variable

I am trying to figure out a way to do this: I want to have a core template file (structure.php): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <?php include_once(NAKIDROOT."includes/head.php"); ?> </head>...

Problems breaking an .htaccess redirect out of an infinite loop

So I have asked for help over at my weblog, scoured the internet, and pored over the examples you all have provided on here before, and I still cannot find an answer that works. Simply put, I am trying to take all traffic referred to my site from Site A, and redirect it all to Page B within my domain. I have gotten the redirect to wo...

Page Unexpectedly redirects when supposed to reload

Hi. I don't know how to explain this properly. The thing is, I have a products page, with a treeview on left, (telerik) and on the right there is a div. The div on the right is used to load stuff in it, (using jquery, calling another aspx with a querystring parameter), called from Telerik Treeview's client-side OnNodeSelecting event ... ...

web.config urlmapping

Hi I have a comment form on my website on contact.aspx. I want to be able to put up a redirect from /comment (no extension) to point to contact.aspx. I set up the following url mapping in my web.config and when I test locally it works fine. When I post it to production, the redirect doesn't happen and I get the IIS 404 error. <system.w...

Url Redirect in Joomla using Htaccess

Hi i want to redirect my URL from http://foo.example.com to http://example.com/foo Please help ...

How long do I need to maintain old URLs?

Ok, I know it is best practice that once you change or remove a page URL, to redirect that url to the new relevant URL. But for how long? forever? For example, I am using Google website optimizer to test different variations of a page. So I have to create a different url for each like: original.php, var1.php, var2.php, etc. once the t...

URL Rewriting in htaccess

I just rebuilt a site that is currently located at http://domainnamehere.com/v2 The existing site is located at http://domainnamehere.com/ I need to set up a redirect so that when someone goes to the old site, it redirects to the new site. I did this on the htaccess file: Redirect /index.html http://domainnamehere.com/v2/ But this...

URL redirect using .htaccess gives 500 Internal Server Error

Hi, I'm trying to redirect anyone surfing to http://forum.student.khleuven.be to http:// forum.kringraad.be. Both URL's redirect to the same directory, basically. I tried the following using .htaccess: Redirect permanent http://forum.student.khleuven.be/ http://forum.kringraad.be/ and also the following: <IfModule mod_rewrite.c> Rewr...

django redirecting not working properly

hello, I'm making a simple vote class, where a user can vote up or vote down an answer. I don't want this function to return anything,as the vote for every user is created when he votes. The problem is that my redirection, or empty return gives me an error like: The page isn't redirecting properly from browser. My code: def vote_answer...

how do I get apache http client 4.0.1 (org.apache.httpcomponents) to redirect automatically to a get after a post?

According to the documentation, the apache http client is supposed to automatically redirect. I am submitting a post to a server, and it has a redirect. Unfortunately, the response handler is giving back an empty string. It just isn't following the redirect and giving me that content directly. Is there an easy way to get the client to fo...

Predetermining redirect_to for awesome navigation

I have a slightly complex navigational system with numerous landing pages, multipage forms, and multiple ways of accessing the standard CRUD functions. Objective: To maintain a variable such as (params[:target]) throughout the system such that each controller knows where to redirect a user based on the location and circumstances of the ...

Spring 3.0 RESTful Controller Fails on Redirect

I am setting up a simple RESTful controller for a Todo resource with an XML representation. It all works great - until I try to redirect. For example, when I POST a new Todo and attempt to redirect to its new URL (for example /todos/5, I get the following error: Error 500 Unable to locate object to be marshalled in model: {} I do know...

Correct Redirected HTTP GET retrieval

Hi, I'd like to know how to do a HTTP GET request to a server from which I know I will get redirected at least a couple of times... I'd like to get the response (body) of the "last" webpage. It should come up with a code in my specific example... Or, as an alternative, I do know you can start the browser from within your Android app, is...

jQuery ajax redirect

Guys i have a little problem when i submit my form the page gets redirected to the result, instead of staying on the same page. On the server-side i have a PHP that spits an simple status codes like this: echo '<span>Success/Error</span>'; exit; and this is my request: jQuery.ajax({ type: "POST", url: "ajax.php", data: dataStr...