Apache Redirect within public_html (~username)

William Attwood wattwood at gmail.com
Fri Apr 30 10:32:27 MDT 2010


RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]


that's one sample, another:
RewriteRule ^pagename.html /newpagename.html [R=301,L]




On Fri, Apr 30, 2010 at 10:30 AM, Michael Torrie <torriem at gmail.com> wrote:

> I have a url, say, http://blah/~torriem/blah that I want to redirect
> with a 301 into a particular wiki page, say
>
> http://blah/~torriem/wiki/blah
>
> I know how to do the Redirects from inside the apache conf file.  How
> can I do this in an .htaccess file in my public_html directory?
>
> Also, my server is accessible via a specific hostname, but sometimes I
> access it by IP address over a VPN.  The Redirect keyword requires a
> complete url to redirect to.  Is there any way to redirect to the new
> path but make sure the hostname part is the same as the original request?
>
> Do I need to do a Rewrite instead?
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>



-- 
Take care,
William Attwood
Idea Extraordinaire
wattwood at gmail.com


More information about the PLUG mailing list