redirect

Unable to make a domain redirection in Django from site.com to www.site.com

I get the following message when I browse to site.com 500 - Internal Server Error I get my 404 error message when I browse to www.site.com which indicates my site is alive. How can you make a domain redirection without .htaccess by Django from site.com to www.site.com? My urls.py from django.conf.urls.defaults import * ...

301 redirect with PHP and MySQL on 404 ... how?

I am transferring a large static website of 500+ pages to a Joomla installation but what I am wanting to do, rather than code a 500+ line .htaccess file, is to use PHP's built in 301 header redirect to dynamically redirect requests that come in to the new URL. So for example, after I move the site, the following URL would 404 without a ...

404 Error Page ~ Redirect an Image - PHP

I use a custom 404 page in a PHP application. On that 404 page, I check for certain 'known' older pages that no longer exist, and then redirect user to newer or most relevant current page. Works great. Now I am faced with a series of old images that have been removed, and am looking for a way to redirect the images to a new image (all ...

apache ProxyPass: how to preserve original IP address

We are using ProxyPass to redirect all "/r" requests to jboss on port 18080 as follows: ProxyPreserveHost on ProxyPass /r http://localhost:18080/redirectService/ ProxyPassReverse /r http://localhost:18080/redirectService/ But, that causes the IP address logged in jboss's access log as "127.0.0.1". Does somebody know how can we preserv...

Redirect files to simple form before downloading

Hi I am trying to redirect all links to any pdf file in my site to a page with a form in it that collects user info before they can proceed to download/view the pdf. Eg I want to redirect *.pdf files in web site to request.php?file=name_of_pdf_being_redirected Where request.php is the page with the form on it asking for a few details ...

How to get HttpWebRequest.AllowAutoRedirect to set the cookies when doing a GET/POST on the redrected page?

Is there a way to get the HttpWebRequest object to take the set-cookie header into account when being automatically redirected to another page through the AllowAutoRedirect feature? I need it to maintain the cookie information across redirects; I'd rather not have to implement the redirect myself if the framework can do this for me. This...

.htaccess rewrite without www AND redirect to subdirectory

I'd like to redirect www.example.com/* to example.com/* And at the same time redirect example.com/* to example.com/forum/* But I also have /wiki/ and /blog/ and /style/, so I don't want to redirect example.com/style/* to example.com/forum/style/* This is what I have at the moment, which is not working quite correctly: Opti...

Asp.net Webform Display Alert and redirect.

Hi all, I'm currently stuck. I have a webform with a button that registers or saves a record. What i'd like to is have it display a javascript alert and then redirect to a page. Here is the code i am using protected void Save(..) { // Do save stuff DisplayAlert("The changes were saved Successfully"); Response.Redirect("D...

How to redirect www.foo.com/bar to www.foo.com:8080 without changing url?

How to redirect www.foo.com/bar to www.foo.com:8080 without "really" changing the url in the url bar? So I want www.foo.com/bar (+ possible GET parameters / subfolders) to be shown always in the url bar. Can this be done with mod_rewrite? ...

same page, different urls. redirect?

Say that I have an article with multiple pages. Each page has a short title for in the URL (wordpress calls them post slugs). If this title is not given in the URL, the first page is shown, so example.com/myarticle is the same page as example.com/myarticle/firstpage. The question is: Should I redirect the former to the latter? And if so...

Will this redirection ">>& <filename>" work in Korn shell?

I am trying to redirect both STDOUT/STDERR of a UNIX command and append to a log file in a korn shell. rm -rf file1 >>& logfile Will this command work in ksh or is this a typical bash command? What harm would I be causing with above command? ...

.htaccess redirect after replace a word?

Hello, I need to use .htaccess file to replace a world in URL something like this: example URL: http://example.com/oldword/test-page.html redirect to: http://example.com/newword/test-page.html how can I use mod_rewrite to redirect every URL containt "/oldword/" to the same URL after replacing that word? ...

Redirect .com to .org in .htaccess

I have domain.com and domain.org as aliases pointing to the same vhost. How can I use .htaccess to redirect all domain.com requests to domain.org? ...

Magic Apache redirecting for /~username

Hi, I have inherited a webserver already serving some websites. I am trying to migrate some of those sites to a new webserver. One of those websites has a page called: http://mydomain/ABCDepartment/ This URL also works: http://mydomain/~joesmith and the index page for joesmith actually lives in /var/www.../ABCDepartment/people/joes...

mod_rewrite or mod_alias ?

I have a server, it's httpd.conf already has some "RedirectMatch permanent" directives in it. I'm not that familiar with mod_alias, I've only ever used mod_rewrite. What's the basic difference? I don't see a "L" flag in mod_alias to stop processing rules. Which one should I use for best practices of redirecting from one subdomain to ...

Redirect Loop in CakePHP

I've got a CakePHP site that is stuck in a redirect loop. I've removed every piece of code that does a redirect & I've turned off autoRedirect on the Auth object. This occurred when I logged out of the site and has persisted even after deleting all cookies and just trying to load the homepage. The index action is in $this->Auth->allow....

What is the proper way to re-direct?

If I have two domain names: altcognito.com and say I've got the other following domain: alt-cognito.com What's the "best" redirect (do I use permanent etc...?) I want to suggest that altcognito.com is the "correct" website. (naturally, these are just examples) ...

re-direct / re-write my domain

firstly, i have already spents the past few hours trying to find a solution for this, but have had nothing but non-working solutions :( it's pretty simple - i'm pointing the DNS of a new domain to my current hosting. but when i visit the new domain, i'm just viewing my original site (the one i got with my hosting). let's say my origina...

PHP generate file for download then redirect

I have a PHP app that creates a CSV file which is forced to download using headers. Here's the relevant part of the code: header('Content-Type: application/csv'); header("Content-length: " . filesize($NewFile)); header('Content-Disposition: attachment; filename="' . $FileName . '"'); echo $content; exit(); What I'd like to do is r...

htaccess redirect old site to 2 different domains

ok so heres the scenario: i got a blog on the root directory of my host then i hosted some app on a subfolder named fsGallery. now, i bought a new domain for my blog and another domain for my app. ii would like to know the proper htaccess 301 redirects in order for me to redirect the old directories to their respective new domains here...