Forum Moderators: phranque

Message Too Old, No Replies

Limit to permanent redirect list

.htaccess permanent limit

         

desiguru

10:27 am on Feb 9, 2009 (gmt 0)

10+ Year Member



Recently I moved a lot of pages to php so I have about 30 permanent redirect urls in my .htaccess and server seems to handle it pretty well. Does anyone know if it can get too big to handle for Apache? I think my list will end up going to about 70-80 links.

Samizdata

10:47 am on Feb 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I wouldn't expect a problem, though judicious pattern-matching might shorten the list.

The real question is "why didn't you just parse the existing files as PHP?".

...

desiguru

7:57 pm on Feb 9, 2009 (gmt 0)

10+ Year Member



Well I didn't know php at all so many pages were made in html and now slowly I'm converting them to php and mysql and stuff. The plan is to keep that .htaccess alive until people online changes their links and then slowly remove them one by one.

jdMorgan

8:10 pm on Feb 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Samizdata's most important point was this: You do not have to change your URLs just because the filenames change. In fact, you don't even have to change your filenames just because the files now contain PHP code. Your .html files can easily be parsed (i.e. "examined, "scanned"," or "processed") by the server to detect and execute PHP code, so neither the URLs nor the filenames needed to be changed at all.

Because changing URLs destroys the integrity of the Web, and usually involves a weeks-to-months drop in search engine rankings, it should not be done unless there is a lawyer or a court forcing you to do it.

Jim

[edited by: jdMorgan at 8:10 pm (utc) on Feb. 9, 2009]

Samizdata

8:13 pm on Feb 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The point I was trying to make is that you should not have to rename or redirect any files.

It is perfectly possible to keep .htm or .html extensions and use PHP content in the files.

Depending on your server setup, something like this should work:

AddType text/html .php
AddHandler php-script .php .html .htm

No redirects would be required.

[Edit - Jim beats me to it once again]

...

[edited by: Samizdata at 8:14 pm (utc) on Feb. 9, 2009]

g1smd

8:53 pm on Feb 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have one site where the URLs end in .aspx but the pages are built using PHP scripts.

The user doesn't need to know, and certainly doesn't care how the pages were actually built.

The URLs could end in .cat or .dog if you wanted. It wouldn't make any difference at all in how they worked.

desiguru

1:43 am on Feb 11, 2009 (gmt 0)

10+ Year Member



Well the reason I am changing is because of two reasons.

Universally common naming, old pages were optimized for SEO but now I want to make all of the pages as simple as possble before the web site gets really popular and then haing to do it, it'd be better to do it now.

Also as a personal choice I want to make everything in .php so that it looks much professional then having half docs in .htm and others in .php.

Thank you again for all of your replies.