Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

need help in mod rewrite with subdomain

Posted on 2009-04-12
7
Medium Priority
?
203 Views
Last Modified: 2012-05-06
i have the following link thats for personal store
http://nsaby.com/index.php?action=mtajer&mtajerid=ajabnoor
i had set the wild card dns in my host
i need to rewrite that link to subdomain like this
http://ajabnoor.nsaby.com
0
Comment
Question by:dr_lionheart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:iserko
ID: 24125172
Place the code snippet into your virtual server or directory statement.

Hope this helps
RewriteEngine on
RewriteCond %{QUERY_STRING} ^.*[\?&]?action=mtajer.*$ [NC]
RewriteCond %{QUERY_STRING} ^.*mtajerid=(\w+)&?.*$ [NC]
RewriteRule ^.*$            http://%1.nsaby.com/? [R,NC]

Open in new window

0
 
LVL 3

Author Comment

by:dr_lionheart
ID: 24127264
the rewrite works ok
but it dose not show that page
this is the code for the store link
<a href=\"index.php?action=mtajer&mtajerid=$ss_link\">

Open in new window

0
 
LVL 3

Expert Comment

by:iserko
ID: 24127289
Oh I get it you want it the other way round. I misread your first text, sorry.

Here's the correction (I didn't test this one yet, so let me know if it works):
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(\w+)\.nsaby\.com.*$ [NC]
RewriteRule ^.*$            http://nsaby.com/?action=mtajer&mtajerid=%1 [L]

Open in new window

0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 3

Expert Comment

by:iserko
ID: 24127290
Fix for line 3
RewriteRule ^.*$            http://nsaby.com/index.php?action=mtajer&mtajerid=%1 [L]

Open in new window

0
 
LVL 3

Author Comment

by:dr_lionheart
ID: 24127306
ok i changed the rewrite rule to
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(\w+)\.nsaby\.com.*$ [NC]
RewriteRule ^.*$            http://nsaby.com/index.php?action=mtajer&mtajerid=%1 [L]


and the output link to
<a href=\"http://$ss_link.nsaby.com\">
and works fine
but the linke in the browser up is displayed like this
http://nsaby.com/index.php?action=mtajer&mtajerid=ajabnoor
0
 
LVL 3

Accepted Solution

by:
iserko earned 2000 total points
ID: 24127326
Try putting P at the end of line 3.
RewriteRule ^.*$            http://nsaby.com/index.php?action=mtajer&mtajerid=%1 [L,P]

Open in new window

0
 
LVL 3

Author Closing Comment

by:dr_lionheart
ID: 31569293
you deserve more than this
thankssssssss
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question