[SLUG] Redirects in Apache
I want to set up a permanent redirect in Apache so that: www.mydomain.com brings up: www.mydomain.com/with/a/long/path/index.html but when I do a straight redirect of / to www.mydomain.com/with/a/long/path/index.html it just keeps the extension the the root URL and promptly bombs. What is the correct method for doing this where the base domain name and the root of the extended domain name are the same. www.mydomain.com is a virtual host BTW. -- Howard. LANNet Computing Associates - Your Linux people http://www.lannetlinux.com -- Flatter government, not fatter government - Get rid of the Australian states. -- There are 10 types of people in the world, those who understand binary, and those who don't. -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] Redirects in Apache
you could try RedirectMatch /* http://www.mydomain.com/with/a/long/path/index.html Being in a VirtualServer shouldn't matter. It works for me. I'm not sure what difference there is between RedirectMatch and RedirectPermanent though. Some erudite person might tell us ;-) BTW, I have an idea that you might need the full URL.. .including the http:// part. But then I could be wrong. That's the way I did it. Once I get something working I'm inclined not to mess around any further. David. On Tue, 4 Mar 2003, Howard Lowndes wrote: I want to set up a permanent redirect in Apache so that: www.mydomain.com brings up: www.mydomain.com/with/a/long/path/index.html but when I do a straight redirect of / to www.mydomain.com/with/a/long/path/index.html it just keeps the extension the the root URL and promptly bombs. What is the correct method for doing this where the base domain name and the root of the extended domain name are the same. www.mydomain.com is a virtual host BTW. -- Howard. LANNet Computing Associates - Your Linux people http://www.lannetlinux.com -- Flatter government, not fatter government - Get rid of the Australian states. -- There are 10 types of people in the world, those who understand binary, and those who don't. -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] Redirects in Apache
On Tue, Mar 04, 2003 at 11:27:41AM +1100, David wrote: I'm not sure what difference there is between RedirectMatch and RedirectPermanent though. Some erudite person might tell us ;-) RedirectMatch is similar to Redirect in that it's a temporary redirection by default. That can be changed by putting permanent between RedirectMatch and the regex. See: http://httpd.apache.org/docs/mod/mod_alias.html#redirectmatch for more detail. Cheers, John -- whois [EMAIL PROTECTED] GPG key id: 0xD59C360F http://kirriwa.net/john/ -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
Re: [SLUG] Redirects in Apache
On Mon, 19 Mar 2001, Howard Lowndes wrote: From how I read the Apache manual the following redirect _should_ work, but isn't: Directory /var/www/guest/LANNet Redirect permanent /var/www/guest/LANNet/GIMP_Manual http://manual.gimp.org/manual/GUM/GUM.html /Directory We use something along the lines of: RewriteRule ^/hamster/(.*) http://www.hamster.com/$1 If that is of any help. Cheers, Mikal -- Michael Still ([EMAIL PROTECTED]) http://www.stillhq.com -- a whole bunch of Open Source stuff including PDF software... "Grrr! I'm a volleyballing machine!" -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
[SLUG] Redirects in Apache
From how I read the Apache manual the following redirect _should_ work, but isn't: Directory /var/www/guest/LANNet Redirect permanent /var/www/guest/LANNet/GIMP_Manual http://manual.gimp.org/manual/GUM/GUM.html /Directory I have a zero length file /var/www/guest/LANNet/GIMP_Manual and all that is happening is the browser returns with an error to the effect that the file contains no data. Can anyone point out where I am going wrong, pse. -- Howard. LANNet Computing Associates http://lannetlinux.com "...well, it worked before _you_ touched it!" --me "I trust just one person, and there are times when I don't even trust myself" --me -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
Re: [SLUG] Redirects in Apache
quote who="Howard Lowndes" Can anyone point out where I am going wrong, pse. That really ought to work regardless of the file being there... What happens if you kill the file? (And, have you restarted Apache if this isn't in a .htaccess file?) - Jeff.still.up.hacking.GOOD.MORNING! -- [EMAIL PROTECTED] --- http://lwn.net/daily/ -- "Ever had a morning where you were not kissed and told "I love you," when the night before you SCREWED so wildly that you could not remember? GOOD MORNING" - Andre Hedrick, Linux ATA Dude -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
Re: [SLUG] Redirects in Apache
Yep, restarted Apache. If I remove the file and type the full URL then I get the 404 File not found error. -- Howard. LANNet Computing Associates http://lannetlinux.com "...well, it worked before _you_ touched it!" --me "I trust just one person, and there are times when I don't even trust myself" --me On Mon, 19 Mar 2001, Jeff Waugh wrote: quote who="Howard Lowndes" Can anyone point out where I am going wrong, pse. That really ought to work regardless of the file being there... What happens if you kill the file? (And, have you restarted Apache if this isn't in a .htaccess file?) - Jeff.still.up.hacking.GOOD.MORNING! -- [EMAIL PROTECTED] --- http://lwn.net/daily/ -- "Ever had a morning where you were not kissed and told "I love you," when the night before you SCREWED so wildly that you could not remember? GOOD MORNING" - Andre Hedrick, Linux ATA Dude -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
Re: [SLUG] Redirects in Apache
Wrote Howard Lowndes, on March 19 around 06:48: Directory /var/www/guest/LANNet Redirect permanent /var/www/guest/LANNet/GIMP_Manual http://manual.gimp.org/manual/GUM/GUM.html /Directory Syntax: Redirect [ status ] url-path url So, assuming DocumentRoot is /var/www, try the line: Redirect permanent /guest/LANNet/GIMP_Manual http://manual.gimp.org/etc/etc -- Cantanker / -/ / [EMAIL PROTECTED] -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
Re: [SLUG] Redirects in Apache
Point take, and I will give it a go, but the doco states: "Also, Url-path must be an absolute path, not a relative path, even when used with .htaccess files or inside of Directory sections." -- Howard. LANNet Computing Associates http://lannetlinux.com "...well, it worked before _you_ touched it!" --me "I trust just one person, and there are times when I don't even trust myself" --me On Mon, 19 Mar 2001, Adrian van den Dries wrote: Wrote Howard Lowndes, on March 19 around 06:48: Directory /var/www/guest/LANNet Redirect permanent /var/www/guest/LANNet/GIMP_Manual http://manual.gimp.org/manual/GUM/GUM.html /Directory Syntax: Redirect [ status ] url-path url So, assuming DocumentRoot is /var/www, try the line: Redirect permanent /guest/LANNet/GIMP_Manual http://manual.gimp.org/etc/etc -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug
Re: [SLUG] Redirects in Apache
quote who="Howard Lowndes" Point take, and I will give it a go, but the doco states: "Also, Url-path must be an absolute path, not a relative path, even when used with .htaccess files or inside of Directory sections." Ah, silly me as well! *URL* path... But they can be absolute or relative just as much as file paths. Didn't pick up on the path you had. :) - Jeff -- [EMAIL PROTECTED] --- http://lwn.net/daily/ -- "Ever had a morning where you were not kissed and told "I love you," when the night before you SCREWED so wildly that you could not remember? GOOD MORNING" - Andre Hedrick, Linux ATA Dude -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://slug.org.au/lists/listinfo/slug