The Gaijin <[EMAIL PROTECTED]> wrote: Joshua Slive wrote: > On 5/9/07, The Gaijin wrote: >> Dave Henderson wrote: >> > Gang, >> > >> > I am pulling my hair out over this. I am trying to redirect the >> > browser so if a user were to type in something like: >> > www.domain.com/fun it would redirect to >> > www.domain.com/games/default.html. I have tried Alias's, redirect and >> > RedirectMatch statements with no luck. Any help would greatly be >> > appreciated. >> > >> > Thanks, >> > >> > Dave >> RewriteRule ^/fun$ http://www.domain.com/games/default.html [R] >> >> May not be the only or best way, but should work a treat. > > That's fine, but to avoid mod_rewrite you can use simply > Redirect /fun http://www.domain.com/games/default.html > or > RedirectMatch ^/fun$ http://www.domain.com/games/default.html > if you want to be more restrictive. > > Joshua. > Dave -
As Joshua has noted Redirect is the most expedient way, but you say that's not working. How exactly is it failing? Apache won't* start? Doesn't redirect** as you would expect? Returns an error**? R. * Run apachctl configtest (or your site equivalent - Debian/Ubuntu call it apachectl or apache2ctl depending on the version of Apache HTTPd you're running) and copy the error into your reply. ** A sanitized copy of the appropriate parts of your httpd.conf or .htaccess would be required to figure out why it's not working. Alias / AliasMatch only work in the server config or vitual host context. Redirect will work in an .htaccess file, but may not be allowed by your server configuration. The appropriate access_log or error_log may also have useful information - copy the appropriate lines in the log to your follow-up as well. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: [EMAIL PROTECTED] " from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks for your replies guys. Yes I have tried both of the methods that Joshua said and neither of them worked. I don't get any errors when apache starts (using 2.0.x) on a Debian Sarge server. I get an error when I try to access the adjusted url (in this case for the 2nd website its http://www.digital-pipe.com/pay should redirect to https://secure.digital-pipe.com/paybill.html), I get a "404 not found" error in the browser. I initially tried to get this to work on another webpage, and then tried it on another thinking that some of the config file for the original site might be causing problems. Here is the relevant config file for the 2nd site I tried. <VirtualHost xxx.xxx.xxx.xxx:80> ...server information here... <Directory /var/www/digital-pipe.com/www> Options Indexes Includes AllowOverride Options Order allow,deny Allow from all Redirect permanent /account.html http://login.digital-pipe.com/account.html Redirect permanent /paybill.html https://secure.digital-pipe.com/paybill.html Redirect /pay https://secure.digital-pipe.com/ssl/paybill.html # Redirect permanent /pay.html https://secure.digital-pipe.com/paybill.html # RedirectMatch ^/pay$ https://secure.digital-pipe.com/paybill.html # RedirectMatch ^/ssl/(.*) https://secure.digital-pipe.com/$1 # RewriteEngine On # RewriteRule ^pay$ /ssl/paybill.html # Redirect permanent /ssl https://secure.digital-pipe.com/paybill.html # Redirect permanent /pay https://secure.digital-pipe.com/terminal.html </Directory> ... log files here... </VirtualHost>