Dino Geek, try to help you

How to make a permanent redirect with Apache?


Making a permanent redirect with Apache can be achieved through the .htaccess file in your website’s main directory.

Here are the steps:

1. Firstly, you need to have enabled the module `mod_rewrite` on your Apache server. If you are unsure, ask your web hosting company to ensure mod\_rewrite is enabled.

1. Use FTP or a file manager in your web hosting control panel to access your website’s main directory. This is usually public\_html or www.

1. Look for a file called `.htaccess`. If it’s already there, download a copy to add a backup.

1. If the file does not exist, create a new one. Some text editors will not allow you to create a file with a name that starts with a period because it’s a reserved system filename. In this case, you can name the file `htaccess.txt` for now.

1. Open the `.htaccess` or `htaccess.txt` file in a text editor.

1. At the top of the file, add the redirect directive:
```
Redirect 301 /old-page.html http://www.yourdomain.com/new-page.html
```

Replace `/old-page.html` with the relative path to the page on the old website, and `http://www.yourdomain.com/new-page.html` with the absolute URL of the page on the new website.

1. Save your changes to the `.htaccess` or `htaccess.txt` file.

1. If you had to save it as `htaccess.txt`, upload it to your website’s main directory and then rename it to `.htaccess`.

For the changes to take effect, you may need to clear your browser’s cache, use a different browser, or force refresh the page (normally Control+F5). Make sure to test your changes after making them to ensure they’re working as expected.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use