开发者

Rewriting example.com/folder/path to example2.example.com/path

Actually the thing is that i'm having a sub domain (example.domain.com) which is redirected from other domain of a folder (www.domain/folder) . but need the rewrite rule for my sub domain which shows the url links for the main domain ie., www.domain/folder/path i need to get as example.domain.com/path. Instead of getting th开发者_Go百科e main domain path i need to expose the URL with sub domain path.


As far as I can tell, there are two ways to do what you are wanting. Both of them require significant extra overhead. Both are also likely to require example.domain.com to lie about who it is.

I wouldn't recommend either if you can avoid it, but.

Method #1

Set up a transparent proxy on www.domain.com/folder to show the contents from example.domain.com. If I recall correctly, this can be done with mod_proxy, but I don't remember how specifically.

Method #2

Set up a rewrite rule on www.domain.com/folder to redirect to example.domain.com. Then set up example.domain.com to either lie about who and where it is, or fix all links in pages on example.domain.com to explicitly go to http://www.domain.com/folder.

In the root .htaccess file on www.domain.com: (to redirect to the subdomain)

RewriteRule ^folder/(.*) http://example.domain.com/$1 [R, L]


Actually the subdomain is created from godaddy account and the maindomain/folder is in other hosting server... masking can be done in top address bar but when i hover through links the actual URL path is displayed in lower left corner of the browser....

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} {HTTP_HOST}[a-zA-Z0-9.-]mydomain/folder/(.)
RewriteRule ^/folder/(.*)$ http://abc.example.in/$1 [L,R=301]

Some one has mailed me the above rewrite rule but still the problem persists...

I have been working on this issue from couple of days and i came to conclusion that 1)From godaddy account i have created a subdomain and forwarded with masking to the actual IP address of the virtual host server, but here comes the problem... i could not forward to the (domainname/foder) rather i can do it for domainname

So i stuck up here for the solution

If u find a solution i would be considered them as a GENIUS......

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜