Forum Moderators: coopster
I definitely want to archive all my old classifieds to keep the content in these ads that was built up over years. However, all of the classifieds have .asp extensions - for example: [mydomain.com...]
I am thinking of converting all of these pages to html that are structured something like -
[mydomain.com...] and doing 301 redirects.
The problem is I would need to do 30,000+ redirects. Is there some type of pattern based .htaccess command I could write to cover all the 301s with a line or two of code?
If not possible with .htaccess magic, maybe something could be done with an on page 301 redirects?
I want to avoid loading some type of asp for apache software to my server which I heard does not work well and can crash a server. But if that's my only option, I would like to know before I start so I can plan this move out properly.
Ideas anyone?
URLs are the names of stuff "as seen from the web". You don't have to use the same names internally. A rewrite using ModRewrite (RewriteRule) can "translate" between the two. I have .php named files, that have PHP scripts inside, but which are accessed from the web using .asp URLs, for example.
If you insist on using all new URLs for this content, then you can do just such a redirect, and ModRewrite (RewriteRule) is just the tool for the job.
In fact, there are only minor differences in the code used with RewriteRule for a rewrite and a redirect. The question is whether you really want to change the URLs for the content. I would continue with the old URL format.
So a modrewrite rule can be done that will be able to rewrite any of the 30,000 pages on the fly?
Maybe this should have been posted in the .htaccess forum?
Thanks!
Using a rewrite (that's a rewrite, not a redirect) you can advertise the same URLs that you have always used, and use whatever filename conventions and scripting you like internally in the server. So you could have a PHP script delivering the content, but still use .asp URLs to access that content. No-one needs to know that you changed to different technology inside the server. URLs are a Resource Locator, used to find stuff on the web. The user of a URL cares nothing about what type of server or what type of script delivered that content. In fact URLs are designed to be platform independant. Any server can send a GIF image out (but it will always have a URL that ends .gif), and any server can send a page of HTML out. For HTML the URL extension can be anything you like, or omitted, as it is the MIME type that announces what type of file is being sent. How that file was built does not matter.
However almost none of those pages exist as files ending in .htm -- They are actually produced by .cgi scripts.
URLs are used on the Web. Filepaths and filenames are used inside servers. They need not even resemble each other. Servers translate URLs to filenames; That is actually their primary job.
Jim