Reputation: 19
I need to redirect an old HTML page to a WordPress page. The site is hosted on IIS server, but it does not appear to be responding to web.config files. Unfortunately, though I have FTP access, I do not have access to the host provider's control panel, in case that is necessary for a solution.
I tried the following inside a web.config in the root of the site
<configuration>
<location path="/direct/path/to/oldpage.html">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.mydomain.com/wordpress/path/newpage/" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
I thought there might be something wrong with my syntax, but even messing it up on purpose resulted in no response from the server, so I'm guessing this is not an option. Are there ways to call or enable a web.config file that does not require access to server settings?
I'd normally do this PHP since the new site has WordPress running, but these files are in a separate directory, and the client already has existing SEO targeting on the old page. So, it's best if the file extension is not changed.
Thank you in advance for any suggestions!
Upvotes: 0
Views: 563
Reputation: 143856
There are a couple of ways to redirect without using rewrite rules, htaccess or web.config routing.
Have the html file (old page) with this in the header:
<meta http-equiv="refresh" content="0;url=http://www.mydomain.com/wordpress/path/newpage/" />
Use javascript, add this to the header of the html file (old page):
<script type="text/javascript">
window.location.href='http://www.mydomain.com/wordpress/path/newpage/';
</script>
Neither of these are really that great of an option as far as SEO goes. Neither are permanent redirects and neither are guaranteed to be followed by robots. Some clients may have javascript turned off, and some clients may ignore META HTTP-Equiv tags.
Upvotes: 1