Hi Team,
I have one requirement
if someone is hitting the domain it should redirect to plp.html without showing the URL in the browser
for redirection, I have added this rule
RewriteRule ^/$ /content/whatsappsim/de/de/plp.html [PT,L]
with this, I am able to redirect but I don't want to show the plp.html to the browser
Ex: -
https://www.whatsappsim.de I am redirecting to https://www.whatsappsim.de/plp.html
I want to serve the content from plp.html, I don't want to show /plp.html to the browser.
how to achieve this
Solved! Go to Solution.
Views
Replies
Total Likes
You can check this
https://httpd.apache.org/docs/2.4/rewrite/remapping.html
Description:
Assume we have recently renamed the page foo.html to bar.html and now want to provide the old URL for backward compatibility. However, we want that users of the old URL even not recognize that the pages was renamed - that is, we don't want the address to change in their browser.
Solution:
We rewrite the old URL to the new one internally via the following rule:
RewriteEngine onRewriteRule "^/foo\.html$" "/bar.html" [PT]
You can check this
https://httpd.apache.org/docs/2.4/rewrite/remapping.html
Description:
Assume we have recently renamed the page foo.html to bar.html and now want to provide the old URL for backward compatibility. However, we want that users of the old URL even not recognize that the pages was renamed - that is, we don't want the address to change in their browser.
Solution:
We rewrite the old URL to the new one internally via the following rule:
RewriteEngine onRewriteRule "^/foo\.html$" "/bar.html" [PT]
Hi @raushan123 ,
You can try this approach, use the [P] flag instead of the [PT] flag in your RewriteRule. The [P] flag stands for Proxy and allows for internal server redirection without revealing the target URL to the client.
Here's an updated version of your RewriteRule:
RewriteRule ^/$ /content/whatsappsim/de/de/plp.html [P,L]
By using the [P] flag, the URL /content/whatsappsim/de/de/plp.html will be internally served without being displayed in the browser's address bar. Please note that for this to work, the Apache HTTP Server needs to be configured properly and have the necessary modules enabled (such as mod_proxy).
https://httpd.apache.org/docs/2.4/rewrite/flags.html