Hi, I am new to web design and i want to redirect my webpage to other page if some certain conditions doesn't satisfay. can any one tell me how to do that.

Thanks, MHRETABK

Dani AI

Generated

For : automatic language-based redirection is doable, but first decide what “browser has Amharic” means — a language preference, or the ability to render Ethiopic characters. Combine three practical measures: detect the user preference (server or client), provide or detect rendering support, and always offer a clear manual switch (as recommended) that persists in a cookie or localStorage.

Server-side detection (Accept-Language) is reliable for preferred UI language. Client-side detection (Navigator.language(s)) runs immediately in the browser and can fall back when headers are absent. Example patterns:

<?php
$al = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '';
if (preg_match('/\bam\b/i', $al)) header('Location: /am/') && exit;
header('Location: /en/');
?>
<script>
var langs = navigator.languages || [navigator.language || navigator.userLanguage];
if (langs.some(function(l){ return l && l.indexOf('am') === 0; })) {
  window.location.replace('/am/');
} else {
  window.location.replace('/en/');
}
</script>

Amharic uses the Ethiopic Unicode block; if a system font is missing the safest move is to ship a web font (for example Noto Sans Ethiopic) so content renders regardless of user fonts. References: Accept-Language header, Navigator.languages, .

Notes and cautions: Accept-Language reflects preference, not font availability. Font-detection hacks are brittle. Automatic redirects can frustrate multilingual users and affect SEO; prefer a gentle redirect or suggestion plus a persistent manual choice. This expands on points from and while keeping the simple English link fallback that advocated.

Recommended Answers

All 7 Replies

What kind of conditions are you talking about? Browser type or whether they have flash player, etc?

What kind of conditions are you talking about? Browser type or whether they have flash player, etc?

Thanks for your reply, and my conditions is language. I want my language to be "Amhric" (Ethiopian ) but if they browser doesn't have that language i need it to redirect to english version

What kind of conditions are you talking about? Browser type or whether they have flash player, etc?

Thanks for your reply, and my conditions is language. I want my language to be "Amhric" (Ethiopian ) but if they browser doesn't have that language i need it to redirect to english version

so if you can please help me
thanks

Just stick a link on the amhric page, with the link text saying "English" in English.

Just stick a link on the amhric page, with the link text saying "English" in English.

thanks for your reply but i realy want my Amharic page to identify the browser weather it has amharic language or not and if not i need it to redirect to my english webpage itself

Thanks,

Does the Amhric language need a special font installed? Can it be represented in Unicode? Do you want to serve an Amhric page to people physically in Ethiopia, and an English page elsewhere, or do you want to serve an Amhric page to anyone who can view Amhric, wherever they are in the world? Basically, what are the conditions under which a browser 'has the Amhric language'?

Either way, that is, even if you find it's possible to do this ( which it might be ); I would certainly do as MidiMagic said, put a link saying 'English' or a frontpage saying 'Which language would you like?'.

It is possible, but the ways to do it all depend on what language you want to use. You cannot do it with HTML alone.

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.