Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- 301'ing over 50 thousand pages


Tom_Cash - 9:31 am on Mar 17, 2011 (gmt 0)


Hiya mate,
First of all, thanks for such a comprehensive solution and sorry for such a delayed reply! I've been absoloutly swamped this week.

I finally got around to implementing it this morning but it didn't work.

I'm don't think I've explained it fully...

OLD: /equipment/4009/siemens/plc/6es5+943-7ua11/6es59437u11/

0 -- equipment
1 -- 4009
2 -- siemens
3 -- plc
4 -- 6es5+943-7ua11
5 -- 6es59437u11

4 is exactly the same as 5 but in it's original format. I have no idea why the old developer did it like that... >.<

Do you think that is where it could be falling over?

Upon running the site with the new code, I get an error 404. Here's a glance at the file structure if this helps:

.htaccess
index.php
equipment/
index.php
other_files.php
etc.php

Here's the .htaccess so far:


# ERROR DOCUMENTS
ErrorDocument 400 http://website.com/error
ErrorDocument 401 http://website.com/error
ErrorDocument 403 http://website.com/error
ErrorDocument 404 http://website.com/error
ErrorDocument 500 http://website.com/error

RewriteEngine On

# REMOVE PHP EXTENSIONS
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]

# HOME
redirect 301 /index http://website.com

# REDIRECT OLD CONTENT
# PRODUCT GROUPS
redirect 301 /search/+/all+manufacturers/+/cnc/2/10/1/ /products/cncs/1
redirect 301 /search/+/all+manufacturers/+/drive/4/10/1/ /products/drives/1
redirect 301 /search/+/all+manufacturers/+/servo+drive/18/10/1/ /products/servos/1
redirect 301 /search/+/all+manufacturers/+/encoder+%26+resolver/5/10/1/ /products/motors_and_encoders/1
redirect 301 /search/+/all+manufacturers/+/plc/14/10/1/ /products/plcs_and_software/1
redirect 301 /search/+/all+manufacturers/+/computer/3/10/1/ /products/indnettrial_pcs_and_hmis/1
redirect 301 /search/+/all+manufacturers/+/monitor/10/10/1/ /products/monitors/1
redirect 301 /search/+/all+manufacturers/+/robot/16/10/1/ /products/robots/1
redirect 301 /search/+/all+manufacturers/+/power+supply/15/10/1/ /products/power_supplies/1
redirect 301 /search/+/all+manufacturers/+/safety+equipment/17/10/1/ /products/safety_equipment/1
redirect 301 /search/+/all+manufacturers/+/comms/34/10/1/ /products/communications/1

# CONTACT
redirect 301 /enquire.php /general_enquiry

# HELP
redirect 301 /help_policies.php /help/policies

# SITE MAP
redirect 301 /visual_sitemap.php /site_map

# REDIRECT OLD EQUIPMENT URLS TO NEW ONES
# Old Structure: equipment/<unique-id>/<brand>/<category>/<product-id>/<product-id-slug>/
# New Structure: equipment/<brand>-<product-id>/<unique-id>
RewriteRule ^equipment/([^/]+)/([^/]+)/([^/]+)/([^+]+)\+([^-]+)-([^/]+)/([^/]+)/$ http://website.com/equipment/$2-$4_$5_$6/$1 [R=301,L]
RewriteRule ^equipment/([a-zA-Z0-9_-]+)/([0-9]+)$ http://website.com/equipment/index.php?name=$1&id=$2 [L]


Thanks again buddy.


Thread source:: http://www.webmasterworld.com/apache/4278367.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com