[Phpwm] Mod rewrite question

Daniel Davies daniel at sitedesign.net
Tue Apr 1 12:04:59 BST 2008


Mike,

Yep its possible using mod rewrite sending a 301 redirect.

I pulled this out of my own .htaccess if it helps. It redirects all 
traffic missing the www. bit of my address to the correct, full domain.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^danux\.co\.uk$ [NC]
  RewriteRule ^(.*)$ http://www.danux.co.uk/$1 [R=301,L]
</IfModule>

A google on '301 redirects' brings up hundreds of examples and scenarios

Mike Tipping wrote:
> I have a client who because most of their site is out of date wants to
> redirect all english and french pages to one external site, all german pages
> to another external site but still allow people to access the admin pages
> and a specific campaign section called ebook.
>
> The site is structured like:
>
> /en/...
> /fr/...
> /de/...
> /admin/...
> /ebook/...
> /other/..
> /etc/
> /etc2/
>
> I presume this is possible with Mod rewrite but everything I try gets the
> whole site to redirect rather than leaving the admin and ebook links
> working.
>
> Any help appreciated.
>
> Cheers
>
> Mike
>
>
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm
>   


-- 
Daniel Davies

Sitedesign.net Ltd
Birchley House
Birchfield Lane
Oldbury
West Midlands
B69 1DT

Tel: 0121 543 4840
Fax: 0121 543 4841

http://www.sitedesign.net

This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Web Sitedesign.net Ltd.




More information about the Phpwm mailing list