PHP_tyro Posted September 23, 2007 Share Posted September 23, 2007 Hi all. I'm coming from an ASP environment and need to convert a website for hosting on Linux/Apache. I think I can handle most of it bit by bit, but there's one thing I need advice on. I have a 404.asp file that handles a lot of redirections. My explorations so far tell me that the way to handle redirection with Linux/Apache is to include a line like the following in the .htaccess file: redirect 302 /DICTIONARY http://www.dictionary.com Simple enough, but what bothers me about that method is the number of redirects that have to be inserted in the file -- at the moment it would add over 400 lines to .htaccess, and more will need to be added over time. Is the size of .htaccess an important consideration? Is there a better way to do this? I like the idea of having a single plain text file containing all the redirections and calling it into a server-side page for processing. Also, I don't understand the difference between 302 and 301 redirects. Temporary and permanent, yes, but what is the effective difference? Many thanks, Billy Quote Link to comment https://forums.phpfreaks.com/topic/70304-best-way-to-do-a-large-number-of-redirects/ Share on other sites More sharing options...
marcus Posted September 23, 2007 Share Posted September 23, 2007 400 lines is what? 1-3kb filesize? Should be no worry there. http://www.seomatrix.com/articles/301-redirects.php Quote Link to comment https://forums.phpfreaks.com/topic/70304-best-way-to-do-a-large-number-of-redirects/#findComment-353157 Share on other sites More sharing options...
gromer Posted September 23, 2007 Share Posted September 23, 2007 400 lines is what? 1-3kb filesize? Should be no worry there. http://www.seomatrix.com/articles/301-redirects.php I think he doesn't want to write them all? Quote Link to comment https://forums.phpfreaks.com/topic/70304-best-way-to-do-a-large-number-of-redirects/#findComment-353160 Share on other sites More sharing options...
marcus Posted September 23, 2007 Share Posted September 23, 2007 Is there a better way to do this? I like the idea of having a single plain text file containing all the redirections and calling it into a server-side page for processing. File isn't going to write itself, eh? Quote Link to comment https://forums.phpfreaks.com/topic/70304-best-way-to-do-a-large-number-of-redirects/#findComment-353162 Share on other sites More sharing options...
PHP_tyro Posted September 23, 2007 Author Share Posted September 23, 2007 400 lines is what? 1-3kb filesize? Should be no worry there. http://www.seomatrix.com/articles/301-redirects.php Yes, I've seen a few articles that talk about 301/302 and page rank, but I don't care about maintaining page rank in this case, because I'm referring/redirecting to sites not owned by me and over which I have no control. For example they might be sites for which I am an affiliate, or sites I am referring my visitor to for more information, or for a download or whatever. I guess in that case it probably doesn't matter whether I use 301 or 302? I think he doesn't want to write them all? No, that's not a problem, I don't need to write them all out. I copied the lot in one go from the IIS server and used Microsoft Word to edit them from the ASP format to the format I quoted above, then pasted them back into Notepad. They are all converted to "Linux speak" and ready to go. The main reason I'd like to have them in a text file that could be automatically imported for server-side processing is for ongoing ease of maintenance. Just editing a text file and FTP'ing it to the server would be simpler and less dangerous than frequent messing with the .htaccess file. Quote Link to comment https://forums.phpfreaks.com/topic/70304-best-way-to-do-a-large-number-of-redirects/#findComment-353168 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.