Page 1 of 1

2. Redirect specific sites

Posted: Sun Feb 09, 2025 7:11 am
by Rina7RS
This is the preferred option if you have multiple applications or sites and do not need an SSL certificate for each of them. Again, only a simple change to the code is required:

server { listen 80; server_name exampleom; .exampleom; return 301 s:exampleom$request_uri;}

As you can see, this code doesn't specify a "default server". Instead, it focuses on a specific hostname. Let's break it down:

" listen 80" ensures that the server block will "listen" for any connections on port 80
Make sure server_name exampleom; .exampleomto specify the server domain name. Of course, your domain name should be replaced with "example".
" return 301 s:exampleom$request_uri" ensures that traffic is redirected to the S version of the website. "301" creates a redirect to the specific URI and sends the user to the S version.
You’ll need to restart or reload Nginx for the changes to take effect. From there, you’ll be ready to go!

How to redirect to S in Windows IIS
If you use Windows IIS, there are two key steps to redirecting from to S on your site. We'll explore them in more detail.

Step 1
Download the IIS URL Rewrite Module
Go to IIS Manager and select the website that needs tunisia mobile database to be redirected
Select URL Rewrite
Click Add Rule, select Blank Rule, and enter a name for your rule. Fill out the following pop-up window as follows:

In the next window, edit the following:

This will take you to the Action section. Here you should make the following changes:
Click to apply!
Step 2
On your IIS dashboard, right-click your site and select Explore.
Open the webonfig file.
Add the following code block if it isn't already there
How to do redirection in Apache
If you use Apache, switching is easy too.