Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Shortening index.php?var= in the URL


g1smd - 7:51 pm on Feb 28, 2012 (gmt 0)


(([^/]+/)*[^/.]+) is "not a slash (one or more times) followed by a slash" [i.e. a folder], the whole "zero or more times" [i.e. any level of folders including none] followed by "not a slash or period one or more times" [i.e. a file without an extension].

So, that's the internal rewrite sorted.

You now need an external redirect to redirect from URLs with parameters to the friendly URL. To prevent a redirect-rewrite loop this redirect also needs a preceding RewriteCond that looks at THE_REQUEST. This will ensure that when the pointer contains parameters, the redirect is invoked only if those parameters were within the original external URL request and not as a result of a prior rewrite.

There's a few hundred previous threads with some example code to get you started. This is a topic that comes up almost every week, sometimes several times per week. :)


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