href="/" not taking me to the home page. | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

kautuk_sahni
Employee
September 25, 2024

@arindampatra15 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni
EstebanBustamante
New Participant
September 13, 2024
pulkitvashisth
New Participant
September 12, 2024

Yes @arindampatra15 
You can achieve this using rewrite rules in dispatcher
Below is the rules to redirect "/" to respective home page based on country code http header.

RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{HTTP_HOST} ^(projectname)(.*)\.com$ RewriteCond %{HTTP:X-country-code} (us) RewriteRule ^/ https://%{HTTP_HOST}/us/en.html

Consider you have multiple locales in your project, then you would need to write each rules as such for each locale. 

If you have just one home page , you can directly use , 

RewriteRule ^/ https://%{HTTP_HOST}/us/en.html
Translate
Level 2
September 13, 2024

Hi @pulkitvashisth Thanks for your help.

Is there any way we can write only once and it handles for all locales? 

We have multiple locales, cant we write a rule, which handles for all locales?

 

Thanks!

Translate
Level 2
September 13, 2024

Hi @pulkitvashisth , This issue is in my local too. Do you think, its a dispatcher issue?

Translate