Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-01-2012, 12:38 PM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,513
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Simple regex problem - please help.

Hi ,

My simple redirect is working EXCEPT if there is a period in the
string.

This is what I have:


PHP Code:
RewriteCond %{HTTP_HOST} ^([^.]+).example.net [NC]
RewriteCond %{HTTP_HOST} !^www.example.net [NC]

RewriteRule ^.*$ http://example.net/disp_page.php?a=%1 [NC,QSA,L] 

So this works fine with :

potatoes.example.net

that goes to example.net/disp_page.php?a=potatoes

and the page displays

BUT if I have

recipes.potatoes.example.net

then it doesn't work

It should go to : example.net/disp_page.php?a=recipes.potatoes

Which would work fine.

Does any one know how I should adjust my code above ?

Thanks.



.
__________________
If you want to attract and keep more clients, then offer great customer support.

Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.

Last edited by jeddi; 03-02-2012 at 06:36 AM..
jeddi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:27 AM.


Advertisement
Log in to turn off these ads.