redirect

Redirect only HTML files?

Part One I want to .htaccess redirect all HTML files to the home page. I looked at this guy's question (http://bit.ly/3l9K86), and wrote this code: RewriteCond %{HTTP_HOST} ^pandamonia.us$ [OR] RewriteCond %{HTTP_HOST} ^www.pandamonia.us$ RewriteRule .*\.html$ "http\:\/\/pandamonia\.us\/" [L] but the problem is that it also redir...

Cakephp is not redirecting properly when pages are cached.

I am having some issues with a site that was working correctly until i implemented full page caching in CakePHP. I have followed the guidance in the Manual and have my $session->flash in a no-cache block as so: <cake:nocache> <? if($session->check('Message.flash')){ $session->flash(); } ?> </cake:nocache> However, whenever a ...

How do I go about getting a page to restart processing in C#?

I'm working with a CMS which allows you to develop your own custom controls which get dynamically included at runtime. So I have a custom control which alters a datasource (NHibernate cache) and as I'm at a point in the process where the CMS has already read this data from the cache, I need to restart the processing of the page somehow s...

Exceptions: redirect or render?

I'm trying to standardize the way I handle exceptions in my web application (homemade framework) but I'm not certain of the "correct" way to handle various situations. I'm wondering if there is a best practice from UI/ user-friendly point of view. User logs into application and opens two tabs showing the same screen. On one tab they ...

Reading content of URL in java - redirect problems

When I execute the following java program, sometimes I get an empty response, sometimes I get the real (redirected) content. ByteArrayOutputStream output = new ByteArrayOutputStream(); URL url = new URL( "http://stackoverflow.com/questions/84629" ); IOUtils.copy( url.openStream(), output ); System.out.println( output.toString() ); The...

Django Admin redirects not working ...

I am using the latest checkout of the django trunk - when I am in the admin on the "change" page for an object/item, there is a nice little link that says "view on site". The link points to a url such as: http://example.com:8888/admin/r/22/15/ However, when I click on that link (or enter that link into my browser) I get redirected t...

How do I redirect values from a PHP page to another?

I'm trying to post XML data from a PHP page to another (not necessarily PHP-based) one without a form post. Is it possible to say do a POST via the header() function? If so, how? ...

Response.Redirect HTTP status code

Why is it that ASP/ASP.NET Response.Redirect uses a HTTP-302 status code ("Moved Temporarily") even though in most cases a HTTP-301 status code ("Moved Permanently") would be more appropriate? ...

Apache authentication: Redirect on failure, reliably?

I've set my ErrorDocument 401 to point to my website's account creation page, but not all browsers seem to honor this redirect (Safari). Also, other browsers (Firefox, Chrome) never quit asking for the password and show the ErrorDocument. This causes a good number of users to give up trying after many password attempts without seeing th...

How to use redirect_to to a non-Rails URL with query params?

We just had an existing use of redirect_to break due to a Rails upgrade, and it led to a question. I've been experimenting, and I don't seem to find a way to use redirect_to to send the user to a non-Rails page with query parameters appended, except by manually constructing the URL string, which seems like a shame. Previously, just a sim...

Redirect output to a bash array

I have a file containing the string ipAddress=10.78.90.137;10.78.90.149 I'd like to place these two IP addresses in a bash array. To achieve that I tried the following: n=$(grep -i ipaddress /opt/ipfile | cut -d'=' -f2 | tr ';' ' ') This results in extracting the values alright but for some reason the size of the array is returned...

.htaccess redirect to a directory

This is a very silly question but I am pretty weak in htaccess. I want all files (php, css, javascripts and images) located at http://localhost/template/* to point to http://localhost/* along with a 404 Error Handler that is located at http://localhost/tempalte/404.php I almost got it here but when I change RewriteRule ^(.*)\.(css|php...

Nginx 301 redirect inc. set cookie

Hi, what I'm looking for is the ability for nginx to detect that a url has the query string variable cid. for example www.adomain.com/froggy?cid=12&as=false (query string can be solo or mixed with others and cid is not necessarily the first variable in the query string) If cid is detected, it must send out a set cookie header with the ...

URL/Apache redirection question. (domain+directory redirect to sudomain)

Hello, I have been trying to figure this out for about 2 hours now. A new requirement came up where it was asked of me to try to find a way to send requests from foo.bar.com/blah to blah.bar.com. Technically /blah doesn't exist, but I was hoping to have the server redirect before it gets to that point. Has anyone had to do this before...

Ruby W3C_Validators and Proxy

Hi, I'm trying to use the w3c_validators Ruby gem and I'm inside a proxy. So I wrote up a monkey patch that overrides the send_request method (validators.rb) and it seems to take the the settings okay. However, once I make the request I encounter this error: 302 "Found" (Net::HTTPRetriableError) I can't tell if this redirect is from...

C++ Redirect Output

Is there a way to redirect c++ output inside the code? The situation is this, I am using some external .cpp and .h files which use printf's to put warnings to console. I wish to redirect "only" these outputs (not mine) to a file "without" modifying their code. So; in my program, I can redirect ouput to a file, and when I will put some o...

Passing parameters using a Zend Framework redirect without appending to URL

In our application, we have certain scenarios where we'd like to perform a redirect and pass a long string to the next controller/action. I'm familiar with both of these: $this->_redirect('/controller/action?string=thisistheverylongstring); But would like to avoid showing the user the string as part of the URL. Throwing the string in...

Sharepoint Redirecting Users or Groups from a page to another.

Hello , What I am tring to do is, when people comes to that page: http://server:26521/MY%5FPortal/service/default.aspx I want them to be redirected to that page http://server:26521/default.aspx Depending on their User name Or User Group. Thanks for helps. ...

Redirecting Content from Blog to Website Drawbacks

What are the drawbacks of using the content/data model of a blog like Blogger or Wordpress to store all of your information and then just having it redirect you to your "real" website? I'm wondering if it's a bad idea to setup a blog and just read/write from it but render it in a completely different project, so I don't have to recreate...

Detecting an URL that redirects to another location

I need to detect when an URL redirects the browser to another location, including javascript redirects. I thought of using an actual web browser engine with javascript support to achieve this, by loading and interpreting the html from the url and setting some sort of "hook" to be notified whenever the browser changes the address. Can an...