Skip to content

Commit 689a2c5

Browse files
Add instructions to give redirects (#675)
* Add instructions to give redirects * Remove extra backtick * add explanation about yourUrl * Replace "yourUrl" with "urlSlug"
1 parent 015b253 commit 689a2c5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,28 @@ In this section, we will guide you through the steps for creating a new FAQ.
380380
4. **Save and Preview:**
381381
* Save the file, then run `jekyll serve` in your terminal to start the local server. Visit `http://localhost:4000` to preview your FAQ.
382382

383+
### How to give redirects?
384+
In this section, we will guide you through the steps for giving a redirect.
385+
386+
1. **Navigate to the html page from which you want to redirect:**
387+
* In the site main directory, open the html page from which you want user to redirect.
388+
389+
3. **Javascript based redirect:**
390+
* In the html file use the script:
391+
```
392+
<script>
393+
window.location.href = "/urlSlug";
394+
</script>
395+
```
396+
* This part uses Javascript to immediately set the `window.location.href` to `/urlSlug`, redirecting the user.
397+
398+
3. **Non-Javascript fallback:**
399+
* In the html file if the Javascript is disabled for the browser use:
400+
```
401+
<noscript>
402+
<meta http-equiv="refresh" content="0; url=/urlSlug">
403+
</noscript>
404+
```
405+
* The `<noscript>`block activates, and the `<meta>` tag trigger a refresh to `/urlSlug` with a delay of 0 second.
406+
407+
This approach ensures seamless redirection regardless of whether Javascript is enabled or not.

0 commit comments

Comments
 (0)