redirect

Unit testing functions with side effects?

Let's say you're writing a function to check if a page was reached by the appropriate URL. The page has a "canonical" stub - for example, while a page could be reached at stackoverflow.com/questions/123, we would prefer (for SEO reasons) to redirect it to stackoverflow.com/questions/123/how-do-i-move-the-turtle-in-logo - and the actual r...

Redirect with Mason 1.0

Hi , i am using mason 1.0 and want to redirect the page to another URL. Is there any way to redirect ? Alternatively.. I have written following code in dbhandler which is giving error stating that $r undefined. Can you please help. $r->method('GET'); $r->headers_in->unset('Content-length'); $r->content_type('text/html'); $r-...

Get htaccess to add value as GET variable when redirecting

Hey, Simply put, what I want to achieve is this, www.example.com/show-products/food should be redirected to www.example.com/show_products.php?cat_id=1 or www.example.com/show-products/clothes should be redirected to www.example.com/show_products.php?cat_id=8 But, I want htaccess to send the GET variables from the URL to the script ...

Drupal hook_form_alter Not redirecting

I am using hook form_alter and setting the $form['#redirect'] = 'dir1/dir2/mypage'. But the form refuses to go there. Form seems to work otherwise, but keeps sending back to the original form instead of the redirect. The form I am altering is from the root user module. mymodule_form_alter( ){ ... code... $form['account...

What is the recommended way to redirect a site to a different site?

As I understand this can be done by either changing the CNAME record in the DNS. Or this can be done using HTTP redirects. I am wondering what is a recommended way of doing this and pros and cons of each approach. What would be friendlier option for search engine like Google? ...

Redirecting default.aspx to root virtual directory

Hi, I have a simple ASP.NET 3.5 application running under IIS7 under a virtual directory. So the URL of my app is like http://site.com/app. I want to 301-redirect the request to site.com/app/default.aspx to site.com/app for better SEO. I have to do this redirect through code only, not by any IIS settings. I am unable to do so via code m...

Changing URL structure of a site - correct technique for SEO appraoch - 301 headers?

Ive been making changes to a old site Ive worked on, one of the tasks Ive taken is to change the url structure to something alot more friendly. For example pages currently work via query strings such as ?action=contact and ?action=article&id123. I am now changing them to /contact and /article/articlename respectively. I would just like t...

codeigniter use of redirect()

I use redirect() (from uri helper) in every function who need to load the main view of my app. It redirect to the same function. My goal is to get the same clean uri, even when i use a pages' feature (that call other controller). Is it good practice? When should i use redirect()? Are there any other solution to get a similar result? th...

Plus signs being replaced for %252520

When I click on my index'd pages in Google the plus signs in my query string are being replaced (encoded?) for %252520. Anyone know why? Example: lovelakedistrict.com/result/?q=Private%252520car%252520park&page=2 should be lovelakedistrict.com/result/?q=Private+car+park&page=2 I have heard that this is a result of redirecting my ...

Possible bug/issue in ASP.NET 3.5 related to Request.RawUrl property

Hi, I posted a query for 301-redirect using ASP.NET 3.5 here: http://stackoverflow.com/questions/3609763/redirecting-default-aspx-to-root-virtual-directory Based on the replies I got there, I realized there might be a bug in ASP.NET's Request.RawUrl method which is unable to return the actual raw url (without /default.aspx) when being...

change word in refered url to direct to correct page

I recently changed a word in my query string in my url, which causes the query to break, so I wish to redirect the old url to the new one. example: http://www.lovelakedistrict.com/result/?q=Windermere&result=2 new url http://www.lovelakedistrict.com/result/?q=Windermere&page=2 What would be the best solution for this, is t...

Is a redirect less efficient than returning other types of result?

Is a redirect less efficient than returning other types of result? I ask because if my current request is asynchronous I want to return a partial with only relevant data. Otherwise I need to render the entire page. So I'm thinking of returning a redirect to an action method which will return a View. My understanding is that a redirect wi...

Response.Cookies gets reset when RedirectToAction is called

IN my asp.net-mvc project I have an AccountController that upon logging in sets a cookie with user preferences to the Request.Response and then does a RedirectToAction. Upon redirecting, the cookies are reset so I loose my settings. The only solution I can come up with is adding the data from the cookie in the tempdata and then fetching...

Google indexing urls redirect 301

Hello, Let say my site has the following URLs indexed in Google: /test/1 /test/2 /test/3 For some reasons, I want those same pages to have the following URLs: /test/abc /test/def /test/ghi I noticed that even if I use a 301 redirect from /test/1 to /test/abc, the URL /test/1 stays in the Google index for a while after the robot hi...

Redirect all links below a subdirectory to a "out of service" page?

I have a directory full of email forms in various subdirectories, linked by various people in various places. I recently found a security problem in some of the forms, and I've taken them all offline, but now when people go to the links they get 404 errors. Is there an easy way, with .htaccess perhaps, to redirect any request for mydom...

Apache mod_rewrite - How to hide $_GET vars from url

When I call the page http://localhost/books-123-name.html?language_id=1 to appear in the browser the following link: http://localhost/books-123-name.html but will keep the value language_id=1 How can this be done? Thanks. ...

Force Jetty to make 301 redirect

I have Jetty application which is very big. I need to replace all 302 redirects to 301. Can I force Jetty to always do 301 redirect when doing response.sendRedirect('someURL') ? ...

Best way to rewrite modern browsers to modern version of app?

I have a Flash app at URL-A. I have a new non Flash version, that only works in modern browsers at URL-B. I can redirect all visitors from URL-A to URL-B with .htaccess or PHP but I wont know what browser they have in order to determine if I need to redirect or not. So I am not sure what the best way to go about this is. Basically if y...

Changing http-referer via a redirect

We are signing up to an online resource that uses http-referer as authentication (bad idea, I know) to prove that the request comes from our intranet (IP address is not available for this as there is a higher level proxy). Unfortunately it might be that their system requires a specific referer URL rather than taking the domain. This wil...

What headers should be set for Redirect on Post?

I'm researching the Redirect on Post method and it seems that there are a few different opinions on how to approach the problem. I'll highlight what I've found and take your advice on what is truely the best practice: Redirection: Should you use Javascript, or HTTP to redirect the page? If you redirect using HTTP, what type of redire...