Tag Archives: redirect

Redirecting System.out to JTextPane

Questions: I have a class (shown below) that extends JPanel and contains a JTextPane. I want to redirect System.out and System.err to my JTextPane. My class does not seem to work. When I run it, it does redirect the system prints, but they do not print to my JTextPane. Please help! Note: The calls are… Read More »

How can I download using PHP a XML file redirected in some weird way?

Questions: The file which I’m trying to download from my PHP script is this one: http://www.navarra.es/appsext/DescargarFichero/default.aspx?codigoAcceso=OpenData&fichero=Farmacias/Farmacias.xml But I can’t do it using neither file_get_contents() nor cURL. I’m getting the error Object reference not set to an instance of an object. Any idea how to do it? Thanks a lot, Pablo. Updated to add the code:… Read More »

Session is lost after an OAuth redirect

Questions: I use CakePHP 2.4. I have an OAuth signin in my website. %99.5 of signins are successfull but %0.5 fails. I have this error for months. I tried many things to debug and log but still I didn’t solve the problem. Although most of the requests are good I need to solve the small… Read More »

PHP: session isn't saving before header redirect

Questions: I have read through the php manual for this problem and it seems quite a common issue but i have yet to find a solution. I am saving sessions in a database. My code is as follows: // session $_SESSION[‘userID’] = $user->id; header(‘Location: /subdirectory/index.php’); Then at the top of index.php after the session_start(), i… Read More »

In htaccess, I'd like to replace underscores with hyphens and then redirect the user the new url

Questions: I’d like to redirect any request that contains underscores to the same url, but with hyphens replacing the urls. I’ve seen a lot of forums suggest I do something like this: (Repeat an incremented version of this rewriteRule up to a gazillion) rewriteRule ^([^_]*)_([^_]*)_([^_]*)_(.*)$ http://example.com/$1-$2-$3-$4 [R=301,L] rewriteRule ^([^_]*)_([^_]*)_(.*)$ http://example.com/$1-$2-$3 [R=301,L] rewriteRule ^([^_]*)_(.*)$ http://example.com/$1-$2 [R=301,L]… Read More »

Will PHP script be executed after header redirect?

Questions: Yes, this question has been asked before, however, the answers have been inconsistent. Take Why I have to call 'exit' after redirection through header('Location..') in PHP? for instance. Every answer (including the accepted answer) states yes, except the last answer which received zero votes which says “maybe”. I am starting to think the correct… Read More »

Redirect to 'www' before ssl requirement

Questions: Problem I currently have the problem where https://domain.com does not redirect to https://www.domain.com and shows an untrusted ssl certificate. This is Related to which is a ruby-on-rails solution redirect to 'www' before force_ssl Question Is there a way to redirect to the www domain before the SSL requirement kicks in? I am using PHP.… Read More »