Yeni Alımlara Özel Hosting, Server, VDS Ürünlerinde %50 İndirim Fırsatı! Kaçırmayın... (Stoklarla Sınırlıdır)

Arama Yap Mesaj Gönder
Mesaj Gönder Arama Yap

Biz Sizi Arayalım

+90
X
X

Select Your Currency

Türk Lirası Euro
X
X

Select Your Currency

Türk Lirası Euro

Knowledge Base

Homepage Knowledge Base How to Perform a 301 Redirect Using .htaccess?

Bize Ulaşın

Halkalı Merkez, Fatih Cd. özgür apartmanı no 45 iç kapı no: 3, 34303 Küçükçekmece/İstanbul

How to Perform a 301 Redirect Using .htaccess?

A 301 redirect is an HTTP status code that indicates a permanent redirect from one URL to another. This is useful for informing search engines and users that a web page has been moved to a new location. The .htaccess file is a configuration file used in Apache web servers and can be utilized to perform various tasks, including 301 redirects. In this article, we'll explain how to perform a 301 redirect using the .htaccess file, step by step.


1. Accessing the .htaccess File

Firstly, ensure you have access to the .htaccess file. The file is typically located in the root directory of your web server. Connect to your server using a file manager or FTP client, and locate the .htaccess file.

2. Defining the Redirect Rule

For example, let's say you want to redirect "example.com/old-url" to "example.com/new-url". In this case, add the following rule to your .htaccess file:

Redirect 301 /old-url http://example.com/new-url

3. Saving Changes and Checking

After adding the redirect rule to the .htaccess file, save the changes and upload the file to your server. Then, using your browser, visit the old URL. You should be automatically redirected to the new URL.

4. Implementing Other Redirects (Optional)

If you want to add multiple redirect rules, you can include each rule on a separate line in the .htaccess file. For example:

Redirect 301 /old-url-1 http://example.com/new-url-1 Redirect 301 /old-url-2 http://example.com/new-url-2

5. Testing and Publishing Changes

To ensure the redirect rule(s) are applied correctly, test each redirect beforehand, and then publish the changes.


By following these steps, you can easily perform a 301 redirect using the .htaccess file. However, exercise caution and ensure you specify the correct URLs. Additionally, don't forget to test your redirects to ensure you achieve the desired results.

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(5 times viewed / 1 people found it helpful)



Call now to get more detailed information about our products and services.

Top