Forum Moderators: phranque

Message Too Old, No Replies

Path Changes with Apache Update?

         

Tksmith

3:13 am on Aug 19, 2005 (gmt 0)

10+ Year Member



I'm trying to confirm an explanation given to me. Thanks for any help. Our school district recently updated Apache web server software. After the update, all URLs on our web pages were changed - the exact change was that K12 was removed from all web page paths. This of course means that all of these pages are now dead links wherever they are bookmarked or listed on other web pages.

The update person said that "the apache server works this way because it is hosting two virtual web pages."

This is the explanation for this huge inconvenience in disabling all of our web pages to external users. My question is this: Is this possible with an Apache upgrade or is it a blunder by the installer during config? And can it be fixed? Thanks very much.

Terry

jdMorgan

3:54 am on Aug 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It was a blunder.

Without knowing how your original site or sites were structured, it's impossible to say exactly what they did wrong, but I'd guess that they did not attempt to preserve the original configuration, or to implement an analogue of it on the new server.

*If* the old URLs are still 'delivered' to your server, you can implement 301-Moved Permanently redirects to point them to the correct 'new' URLs. Alternatively, you may be able to make it look like those URLs are still good, even though your server's directory structure is now different.

The old URLs are still being delivered to your server if you see the 404 errors logges in your server access and/or error log.

Either way, the sooner you take action, the less likely it will be that permanent 'damage' will be caused with respect to your search engine rankings or 'findability.'

If you post a few example URLS --old and new-- with the specifically-identifiable information obscured, maybe we can help. As an example, in order to comply with our Terms of Service, all Webmasters here have their site at 'www.example.com' and we all sell widgets. :)

Jim

Tksmith

4:15 am on Aug 19, 2005 (gmt 0)

10+ Year Member



Thank you, Jim. This is exactly what I suspected.

Here are some example links:

Web paths used to contain K12:
http://www.city.k12.state.us/K12/EField/TaiwanCamp/

After the Apache upgrade:
http://www.city.k12.state.us/EField/TaiwanCamp/

This was the only change throughout the system that I know of.

So now this page is unfindable.

Any ideas on specific fixes would be great. I would pass them on to our tech person.

Terry

[edited by: jdMorgan at 4:45 am (utc) on Aug. 19, 2005]
[edit reason] Obscured specifics. [/edit]

jdMorgan

4:44 am on Aug 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming that http://www.city.k12.state.us/K12/EField/TaiwanCamp/ is a URL which used to work, and now is broken, and that you can add and execute server directives, then adding the following code to either the server configuration file httpd.conf or to the .htaccess file in your top-level Web directory (your "home page" directory) should fix the problem:

RedirectMatch 301 ^/K12/(.*)$ http://www.city.k12.state.us/$1

The regular-expressions pattern (.*) in the path on the left matches any filepath info past "K12" and saves it for re-use as $1 in the new URL on the right. Therfore, any resource requested from the old URL http://www.city.k12.state.us/K12/<anything> is redirected to the new location at http://www.city.k12.state.us/<anything>.

See Apache mod_alias [httpd.apache.org] for more information.

This is the simplest solution; If you're lucky, it's all you'll need.

Jim

Tksmith

4:57 am on Aug 19, 2005 (gmt 0)

10+ Year Member



Thank you very very much. It sounds like this will work. I will pass it along to our tech person and hope they will give it a try.

Terry

jdMorgan

5:27 am on Aug 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Terry,

You're welcome. And welcome to WebmasterWorld!

Jim
(who appreciates educators, and those who support them)

Tksmith

11:58 am on Aug 20, 2005 (gmt 0)

10+ Year Member



Jim,

For clarification - the command line you sent does not change any files on the system. Right? It intercepts incoming requests for the old path (K12) and redirects the incoming request to the web page at the changed path (without K12).

And does this command need to be put in both files? Is the result seen immediately?

There is some reluctance to make any changes in our school district - I am trying to reassure the tech person that this is only a redirect to help remote users of previous links. Thank you so much.

Terry

Leosghost

12:17 pm on Aug 20, 2005 (gmt 0)

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



Tell your tech people that if they would care to come here and lurk and read the threads ,and the older ones particularly in this section that when Jim says something is.. then it is ..:)

Trust that man with your server ..it will come to no harm and it will thank you ..

And also welcome to WebmasterWorld

jdMorgan

4:31 pm on Aug 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jim,
For clarification - the command line you sent does not change any files on the system. Right? It intercepts incoming requests for the old path (K12) and redirects the incoming request to the web page at the changed path (without K12).

Correct.

And does this command need to be put in both files?

No, either one will do. httpd.conf is more secure since it is a 'system-level' file, while .htaccess is more convenient, since it is a 'user-level' file. I'm using those terms loosely, so as to avoid writing a book here.

Is the result seen immediately?

Yes, but you must flush your browser cache (Temporary Internet Files) before testing the change. Otherwise, your browser may display previously-cached results (including 'missing page' error pages).

There is some reluctance to make any changes in our school district - I am trying to reassure the tech person that this is only a redirect to help remote users of previous links. Thank you so much.

The mod_alias documentation I cited above is recommended reading... No, make that a homework assignment. :)

Jim

Thanks for the vote of confidence Leosghost, but I'm fallible, just like everyone else...

Tksmith

5:15 pm on Aug 20, 2005 (gmt 0)

10+ Year Member



Jim - again thanks. I am learning quite a bit about web servers from this site. I do lots of internet projects with elementary kids and have many web pages, but no authority at the web server level. So, I hope I can convince others that editing the httpd.conf file makes it so that users can find our missing links, and will not destroy the entire system! :-) ahhh, education...

Terry