HELP rewrite for email addresses

Discuss practical ways rearrange URLs using mod_rewrite.

HELP rewrite for email addresses

Postby russ023 » Fri May 23, 2008 4:50 am

Hi I wonder if anyone can help me I want to rewrite the following:

http://www.website.com/name@email.co.uk

to:

http://www.website.com:8080/public_cand ... mail.co.uk

where name@email.co.uk is any email address that is registered on my website.

I have setup as follows:

<VirtualHost *>
ServerName local
ProxyRequests Off
ProxyPreserveHost On
RewriteEngine on
RewriteRule /([A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+)$ http://localhost:8080/public_candidate_ ... f?email=$1 [nc,P]
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>

but I get a 404 error any idea?
the reverse proxy is setup on the local box I am not sure if this is conflicting.

thanks in advance :)
russ023
 
Posts: 1
Joined: Fri May 23, 2008 4:43 am

Postby richardk » Sun May 25, 2008 10:18 am

Try
Code: Select all
<VirtualHost *>
  ServerName local

  RewriteEngine On
  RewriteRule ^/([a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]+)$ /public_candidate_profile.jsf?email=$1 [NC,L]

  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass / http://localhost:8080/
  ProxyPassReverse / http://localhost:8080/
</VirtualHost>


Or
Code: Select all
<VirtualHost *>
  ServerName local

  RewriteEngine On
  RewriteRule ^/([a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]+)$ /public_candidate_profile.jsf?email=$1 [NC]

  RewriteRule ^(/.*)$ http://localhost$1 [P,L]
</VirtualHost>
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 18 guests

cron