Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- A guide to fixing duplicate content & URL issues on Apache


jdMorgan - 7:05 pm on Jan 5, 2007 (gmt 0)


Thanks all, and "hsieh hsieh ni" to codemeit

I found an optimization to shorten this up. Replace these two rules:

# Replace comma(s) in page filepaths with period (e.g. "/page,html")
RewriteCond %{ENV:myURI} ^([^,]+),+\.*((s?html?¦php[1-9]?¦pdf¦xls).*)$ [NC]
RewriteRule . - [E=qRed:yes,E=myURI:%1.%2]
#
# Remove multiple filetype delimiter periods (e.g. "/page..html")
RewriteCond %{ENV:myURI} ^([^.]+)\.{2,}((s?html?¦php[1-9]?¦pdf¦xls).*)$ [NC]
RewriteRule . - [E=qRed:yes,E=myURI:%1.%2]

with this one that does both:

# Replace comma(s) or multiple filetype delimiter periods in page filepaths
# with a single period (e.g. "/page,html" or "/page..html")
RewriteCond %{ENV:myURI} ^([^,.]+)([,.]{2,}¦,)((s?html?¦php[1-9]?¦pdf¦xls).*)$ [NC]
RewriteRule . - [E=qRed:yes,E=myURI:%1.%3]

Anything that can be done to make this pile of code smaller and easier to modify/maintain...

Replace all broken pipe "¦" characters in the code above with solid pipes before use; Posting on this forum modifies the pipe characters.

Jim


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