Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- rewriterule


jdMorgan - 1:18 pm on Apr 7, 2006 (gmt 0)


If you wish to change the URL requested from your server, you must change the URL that appears on your pages.
Then use mod_rewrite to detect those 'special' URLs, and rewrite them to your script with the additional script variable.

Something like:

# handle "view=24" case
RewriteRule ^(view-[0-9]+)-([^.]+)\.htm$ $2.htm?var=$1 [NC,L]
# handle other cases
RewriteRule ^([0-9a-z]+)-([^.]+)\.htm$ $2.htm?var=$1 [NC,L]

The [NC] flag makes character comparison case-insensitive, and is faster than using [A-Za-z] in the pattern. The [L] flag tells mod_rewrite to stop processing rules if the pattern matches and the URL is rewritten.

Jim


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