Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Urgent Rewrite Question

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
URGENT: deny,allow question (EASY) - Hi I need to allow people at 10.1.*.* and 10.2.*.* to access a certain location, but I need to prevent people at 10.1.65.* to do so. Will this work: Order deny from allow from 10.1..

rewrite question - Hi, I have changed some of the structure on my server and dont want to let the know. I used to host a page on and now its on currently my server is set to rewrite..

URL Rewrite question - Hello all, I'm new to this so please be gentle. I don't want people accessing my site to use the www part for various reasons. Most people when linking to my site seem to use the version of the url. So I want the URL to be..

url rewrite question - I'm just beginning to poke around in apache so I want to check this before I try it. Problem: People who think my server is IIS and trying to get various *.exe and *.dll files in an attempt to the server. The directory path used..

mod rewrite question - I'm hoping I can get an answer to one of the 4 questions I've posted to this group over the last couple of months, so here goes. I'm serving XHTML files as as they should be. But IE doesn't like this. What I wanted to do was use..
Next:  Apache: Rewrite Rule for subdomains?  
Author Message
nospam261

External


Since: Jan 28, 2005
Posts: 1



(Msg. 1) Posted: Fri Jan 28, 2005 7:35 am
Post subject: Urgent Rewrite Question
Archived from groups: alt>apache>configuration (more info?)

Hi,
I'm trying this type of configuration without success:
what I need is:

a-b-c.mydomain.com:8080/directory/page-name.htm

need to be rewrite in

www.mydomain.com:8080/directory/xyz.php?param1=a-b-c&param2=page-name

I'm trying to do this using configuration I read around but I find I'm not
able ... sigh!!

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
RewriteRule
^http://([a-z0-9A-Z,\-]+)\.mydomain\.com:8080/directory/(.*).htm$
/directory/test.php?sd=$1&p=$2 [L]

Can you help me?

Thanks,
a.

 >> Stay informed about: Urgent Rewrite Question 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Fri Jan 28, 2005 2:35 pm
Post subject: Re: Urgent Rewrite Question [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ivan" <nospam.TakeThisOut@nospam.com> schreef in bericht news:41fa24bc@x-privat.org...
 > a-b-c.mydomain.com:8080/directory/page-name.htm
 > need to be rewrite in
<font color=purple> > <a style='text-decoration: underline;' href="http://www.mydomain.com:8080/directory/xyz.php?param1=a-b-c&param2=page-name</font" target="_blank">www.mydomain.com:8080/directory/xyz.php?param1=a-b-c&param2=page-name</font</a>>
 > I'm trying to do this using configuration I read around but I find I'm not
 > able ... sigh!!
 >
 > RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
 > RewriteCond %{HTTP_HOST} !^mydomain\.com [NC]
 > RewriteRule
 > ^http://([a-z0-9A-Z,\-]+)\.mydomain\.com:8080/directory/(.*).htm$
 > /directory/test.php?sd=$1&p=$2 [L]
Protocol, server, domain and port are NOT part of the URL here ...

Based on an example found at
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/misc/rewriteguide.html" target="_blank">http://httpd.apache.org/docs-2.0/misc/rewriteguide.html</a>
I'ld try -aka code comes untested-:
RewriteEngine on
# prepare to convert to lower case
RewriteMap lc int:tolower
# skip plain www in domain
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
# check for and isolate servername
RewriteCond %{HTTP_HOST} ^([^\.]).mydomain\.com [NC]
# use servername and partial path as parameters
RewriteRule ^directory/(.*).htm$ /directory/test.php?sd=${lc:%1}&p=$2 [L]

Enjoy (testing),

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Urgent Rewrite Question 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]