hi all,

i am redirecting http://test.asia/ to folder. but my problem is i don't want to show in address bar. i want to display http://test.asia/ instead of . i tried this using iframes and cloning but query strings are not showing .

anyone have any idea please help me

thanks in advances,

Raja.B

Dani AI

Generated

asked for a masked redirect so the browser keeps showing http://test.asia/ while serving content from http://test.com.au/asia/. correctly pointed to .htaccess as one route and posted a redirect reference, but the robust, reliable approach is a reverse proxy rather than an iframe or simple forwarding. Iframes hide the address bar but commonly lose query strings or break links and cookies; a proper reverse proxy forwards requests (including query strings) and rewrites headers so the client never sees the backend host.

Recommended (Apache vhost, requires mod_proxy and mod_proxy_http):

<VirtualHost *:80>
    ServerName test.asia
    ProxyRequests Off
    # Use ProxyPreserveHost On only if the backend expects the original Host header
    # ProxyPreserveHost On
    ProxyPass        /  http://test.com.au/asia/
    ProxyPassReverse /  http://test.com.au/asia/

    # If backend uses HTTPS:
    # SSLProxyEngine On
</VirtualHost>

If vhost access is not available, a .htaccess fallback with mod_rewrite (and mod_proxy enabled) can proxy requests and preserve query strings:

RewriteEngine On
RewriteRule ^(.*)$ http://test.com.au/asia/$1 [P,QSA,L]

Notes and troubleshooting:

  • ProxyPass/ProxyPassReverse must be in server/vhost config; ProxyPassReverse fixes Location headers on redirects.
  • HTML body links, absolute URLs and cookie domains may still point to test.com.au. Use mod_proxy_html or mod_substitute to rewrite in-body links, and ProxyPassReverseCookieDomain / ProxyPassReverseCookiePath to rewrite cookie attributes if needed.
  • On shared hosting without proxy modules, a minimal PHP cURL proxy can work but requires careful header handling and strict host checks (security risk otherwise).
  • Verify with curl -I and test actual query-string behavior. Masking works, but expect extra setup for redirects, cookies and SSL.

Recommended Answers

All 4 Replies

Member Avatar for Member #733618

I think that you must use .htaccess...

thanks for replay, how do we write htaccess.

Dear,

i have mobile device detection code using php.i want using different type of url in php code like rtsp,http,etc ., urls are so length thats why i redirect single small url please help us.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.