is it possible to invert the url
8 posts
• Page 1 of 1
is it possible to invert the url
I have the querystring with parameters working fine with this rewrite rule;
^([0-9,a-z,A-Z,_,-]+)\.asp$ http://myDomain.com/document/view.asp?ae=$1 [NC,R=301,L]
which rewrites for example to;
myDomain/EZas123.asp but can I turn around so that I have?,
EZas123.asp.myDomain (or something similar) and 2nd question, can I write this without the .asp extension?
EZas123.myDomain (this is my final objective)
Thanks
^([0-9,a-z,A-Z,_,-]+)\.asp$ http://myDomain.com/document/view.asp?ae=$1 [NC,R=301,L]
which rewrites for example to;
myDomain/EZas123.asp but can I turn around so that I have?,
EZas123.asp.myDomain (or something similar) and 2nd question, can I write this without the .asp extension?
EZas123.myDomain (this is my final objective)
Thanks
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: is it possible to invert the url
Would you, please, clarify what is the request you want to type on the browser and what landing URL do you want to have?
Regards
Andrew
Regards
Andrew
Re: is it possible to invert the url
Thanks for the quick reply
typed in the browser would be...
EZas123.myDomain.com
this would then redirect to...
http://myDomain.com/document/view.asp?ae=EZas123
I's like a subdomain but has to be dynamic generated, that's why I'm looking for a rewrite rule.
typed in the browser would be...
EZas123.myDomain.com
this would then redirect to...
http://myDomain.com/document/view.asp?ae=EZas123
I's like a subdomain but has to be dynamic generated, that's why I'm looking for a rewrite rule.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: is it possible to invert the url
ok, lets try:
In case you want it to be a proxy request, please, add [P] in the flag section. In this case EZas123.myDomain.com will stay in the browser.
Regards
Andrew
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} !^www\.myDomain\.com$
RewriteCond %{HTTP:Host} ^(.+)\.myDomain\.com$
RewriteRule ^$ http://myDomain.com/document/view.asp?ae=%1 [NC,L]
In case you want it to be a proxy request, please, add [P] in the flag section. In this case EZas123.myDomain.com will stay in the browser.
Regards
Andrew
Re: is it possible to invert the url
I'm not sure that what's wanted is actually possible:
If you type EZas123.myDomain.com, surely that would need there to be an A or CNAME record for "EZas123.myDomain.com" pointing to the server?
Or does this rely on wildcarding? If so- what do you put in the <VirtualHost> tags to match anything? Can you put *.MyDomain.Com?
If you type EZas123.myDomain.com, surely that would need there to be an A or CNAME record for "EZas123.myDomain.com" pointing to the server?
Or does this rely on wildcarding? If so- what do you put in the <VirtualHost> tags to match anything? Can you put *.MyDomain.Com?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: is it possible to invert the url
It is possible, we've done it before. No manipulations with A or CName is needed. However, we've never tried <VirtualHost> for that. Usually just put it in .htaccess as workaround.
Regards
Andrew
Regards
Andrew
Re: is it possible to invert the url
That is slicker than a greased pig on downhill skis!
It works perfectly!
btw, does this present any additional security issues to be aware of.
Thanks for your help!
It works perfectly!
btw, does this present any additional security issues to be aware of.
Thanks for your help!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: is it possible to invert the url
I don't know. Can it? We can narrow it down a little... by amount of symbols. But i'm not sure it's necessary.
regards
Andrew
regards
Andrew
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests