I have 2 webpages
2)https://www.samplepage.com/index.html
I have a requirement where i need to redirect to https://www.samplepage.com when clicked https://www.samplepage.com/index.html . Could you please explain what could be done?
Solved! Go to Solution.
Views
Replies
Total Likes
RewriteCond %{REQUEST_URI} ^/index.html$
RewriteRule ^/(.*) / [R=301,L]
RewriteCond %{REQUEST_URI} ^/index.html$
RewriteRule ^/(.*) / [R=301,L]
In which file do we need to specify these?
As part of rewrite rules fine under /dispatcher/src/conf.d/rewrites folder
Below rule worked for me
RewriteCond %{REQUEST_URI} ^/index.html$
RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L]
@vineetham123 Just in case if you want to validate it online. use below URL
https://htaccess.madewithlove.com?share=b3f964bd-48be-43aa-948d-d354ab4e2a97
And also where to write this condition is as below. If you are on AEMaaCS write it in the vhost files located at below location
/dispatcher/src/conf.d
If you are on AMS / on-prem you can write a custom rewrite rule and load in vhost files
path /dispatcher/src/conf.d/rewrites
<IfModule mod_rewrite.c>
RewriteEngine on
Include conf.d/rewrites/rewrite.rules
RewriteCond %{REQUEST_URI} ^/index.html$
RewriteRule ^(.*)index\.html?$ "/$1" [R=301,L]
</IfModule>
@Imran__Khan But I think the ask is "i need to redirect to https://www.samplepage.com when clicked https://www.samplepage.com/index.html ." I am hoping the internal pass through is already managed
Views
Likes
Replies