Skip to content

Commit

Permalink
Add instructions to give redirects (#675)
Browse files Browse the repository at this point in the history
* Add instructions to give redirects

* Remove extra backtick

* add explanation about yourUrl

* Replace "yourUrl" with "urlSlug"
  • Loading branch information
therealharshit authored Feb 21, 2025
1 parent 015b253 commit 689a2c5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,28 @@ In this section, we will guide you through the steps for creating a new FAQ.
4. **Save and Preview:**
* Save the file, then run `jekyll serve` in your terminal to start the local server. Visit `http://localhost:4000` to preview your FAQ.

### How to give redirects?
In this section, we will guide you through the steps for giving a redirect.

1. **Navigate to the html page from which you want to redirect:**
* In the site main directory, open the html page from which you want user to redirect.

3. **Javascript based redirect:**
* In the html file use the script:
```
<script>
window.location.href = "/urlSlug";
</script>
```
* This part uses Javascript to immediately set the `window.location.href` to `/urlSlug`, redirecting the user.

3. **Non-Javascript fallback:**
* In the html file if the Javascript is disabled for the browser use:
```
<noscript>
<meta http-equiv="refresh" content="0; url=/urlSlug">
</noscript>
```
* The `<noscript>`block activates, and the `<meta>` tag trigger a refresh to `/urlSlug` with a delay of 0 second.

This approach ensures seamless redirection regardless of whether Javascript is enabled or not.

0 comments on commit 689a2c5

Please sign in to comment.