Skip to main content
Participant
March 1, 2009
Question

getURL not working without WWW

  • March 1, 2009
  • 2 replies
  • 386 views
Hi there,

I have created one website www.slcc.sg.
Problem is I type www.slcc.sg , links its work
but I type http://slcc.sg, all link are not working,
please tell me whats problem this

Thanks,

Regards,
Darpan
This topic has been closed for replies.

2 replies

Participant
June 20, 2024

The issue you're experiencing is likely due to the website's configuration not properly handling requests without the "www" prefix. Here's how you can resolve it:

1. Set Up Redirects in Your Web Server Configuration

You need to configure your web server to redirect all traffic from `http://slcc.sg` to `http://www.slcc.sg`. The specific steps depend on the type of web server you are using (e.g., Apache, Nginx, etc.).

For Apache:

1. Open the `.htaccess` file in your website's root directory.
2. Add the following lines to redirect non-www to www:

```apache
RewriteEngine On
RewriteCond %{HTTP_HOST} ^slcc.sg [NC]
RewriteRule ^(.*)$ http://www.slcc.sg/$1 [L,R=301]
```

For Nginx:

1. Open your site's configuration file, usually located in `/etc/nginx/sites-available/` or `/etc/nginx/conf.d/`.
2. Add the following server block:

```nginx
server {
listen 80;
server_name slcc.sg;

return 301 http://www.slcc.sg$request_uri;
}
```

2. Update DNS Settings

Ensure that both `www.slcc.sg` and `slcc.sg` point to your web server's IP address in your DNS settings.

1. Log in to your domain registrar's website.
2. Find the DNS management section.
3. Create two A records:
- One for `www.slcc.sg` pointing to your server's IP address.
- Another for `slcc.sg` pointing to your server's IP address.

3. Ensure SSL Certificates Cover Both Domains

If you are using HTTPS, ensure your SSL certificate covers both `www.slcc.sg` and `slcc.sg`.

- If you are using a tool like Let's Encrypt, you can issue a certificate that covers both domains using the following command:

```sh
sudo certbot --nginx -d slcc.sg -d www.slcc.sg
```

4. Verify Configuration

After making these changes, test your website shala darpan login by accessing both `http://slcc.sg` and `http://www.slcc.sg` to ensure they both redirect correctly and the links work as expected.

By following these steps, you should be able to resolve the issue with links not working when accessing `http://slcc.sg`.

kglad
Community Expert
Community Expert
March 1, 2009
i don't see a problem.