You can still set up a 301 redirect without .htaccess. The right method depends on which settings or code you can change. If you can edit the server configuration, use the main configuration file. If you can run server-side code such as PHP, use it to send redirect headers. WordPress users can consider a plugin. If you can only edit static HTML, consider meta refresh, with JavaScript as a last resort. Not all of these methods produce an HTTP 301 response: what the server returns and how search engines handle the redirect are separate questions.
If you can edit the server configuration, you do not need .htaccess
.htaccess is only one configuration option. Public technical discussions note that you can also set up redirects in the server’s main configuration file. A 2021 Semrush article demonstrates this using an Apache Virtual Host, which requires full control over the configuration files. The example redirects HTTP to HTTPS, so it should not be applied unchanged without considering your environment.
If you do not have these permissions, ask your administrator or hosting provider for help. Include the old URLs and their destination URLs rather than simply saying, “Redirect everything to the new site.” Google’s documentation recommends permanent server-side redirects whenever possible for migrations you are certain will not be reversed. Both 301 and 308 indicate a permanent move.
If you can run code or manage WordPress, there are other options
Even if you cannot edit .htaccess, you can still set up redirects if you can modify the server-side code. Google’s documentation notes that, besides editing server configuration files, you can set redirect headers through server-side scripts such as PHP.
- Code-based option: Have server-side code return the required redirect status code and destination URL. There is no need to switch to browser-side JavaScript.
- WordPress option: Semrush’s 2021 article demonstrates setting up permanent redirects with a plugin, without manually editing .htaccess. This shows how it worked at the time; it does not guarantee that all current versions or plans offer the same functionality.
If you can only edit HTML, understand how the alternatives differ
Google’s documentation classifies a 0-second meta refresh as a permanent redirect and a delay greater than 0 seconds as temporary. This is Google’s classification of the method; it does not mean the server returns HTTP 301.
Use JavaScript only when neither server-side redirects nor meta refresh is possible. This is not because JavaScript necessarily fails, but because Google needs to render the page to recognize the redirect. If rendering fails, Google may not detect it.
Map the URLs first, then test the old ones
Whichever method you use, first list the URLs you need to move and map each one to its destination. For example, the page for a red product on the old site should map to the page for the same product on the new site, rather than sending every URL to the homepage. Multiple “About Us” pages with overlapping content can map to a consolidated introduction page.
After setup, enter each old URL to confirm that it reaches the expected page. Clear the cache first if necessary. If a page has been deleted and there is no relevant replacement content, you can leave the URL returning a 404 rather than forcing a redirect just to eliminate the error.
Redirects without .htaccess: perspectives from across the web
Where can you configure permanent redirects on Windows hosting without .htaccess?
If your website runs on IIS on a Windows host, you may be able to configure permanent redirects in IIS without adding code to the web pages. A 2011 tutorial also notes that shared hosting users may need help from their hosting provider. Your options depend on the hosting environment and your administrative permissions, so do not assume that the tutorial's interface instructions still apply.
What are the concerns about going through a forwarding script before redirecting to the destination page?
The main concern is that this adds redirects. In a public discussion, one participant opposed the approach for this reason and argued that it reduces the value of links to the bare domain to zero. Another participant felt that multiple redirects mainly benefit users. These are the participants' judgments. The available discussion does not establish that link value necessarily drops to zero or that search engines generally do not follow multiple redirects.
An old article says meta refresh plus canonical is a 301. Can that claim be accepted as-is?
No. In a specific situation where the hosting provider could not help, a 2011 article recommended using meta refresh and canonical on static pages and described its understanding of how search engines handled them at the time. However, this does not mean the server returns HTTP 301. The supplied Google documentation classifies a 0-second meta refresh as a permanent redirect, unlike the old article's claim that Google would treat it as a 302.
References
- 重新導向與 Google 搜尋 | Google 搜尋中心 | Documentation | Google for Developersdevelopers.google.com — Discusses: An old article says meta refresh plus canonical is a 301. Can that claim be accepted as-is?
- Are there any significant disadvantages of forwarding a naked domain to the www. homepage always?webmasters.stackexchange.com — Discusses: What are the concerns about going through a forwarding script before redirecting to the destination page?
- [SEO技巧]靜態網頁如何正確設定301轉址(REDIRECT)?www.awoo.ai · 2011-02-16T03:54:36+00:00 — Discusses: Where can you configure permanent redirects on Windows hosting without .htaccess?; An old article says meta refresh plus canonical is a 301. Can that claim be accepted as-is?
- Combine websites without hurting SEOwebmasters.stackexchange.com — Source used in the article above.
- Combine websites without hurting SEOwebmasters.stackexchange.com — Source used in the article above.
- Complete .htaccess File Tutorial: What It Is & How to Use Itwww.semrush.com · 2021-10-06T19:45:00Z — Source used in the article above.
- How to Redirect HTTP to HTTPS (4 Methods)www.semrush.com · 2021-06-03T20:05:00Z — Source used in the article above.
- Are there any significant disadvantages of forwarding a naked domain to the www. homepage always?webmasters.stackexchange.com — Discusses: What are the concerns about going through a forwarding script before redirecting to the destination page?
- Are there any significant disadvantages of forwarding a naked domain to the www. homepage always?webmasters.stackexchange.com — Source used in the article above.




