Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Hide/changing .php?=


g1smd - 12:18 pm on Oct 2, 2012 (gmt 0)


That code doesn't "remove the PHP extension".

It maps extensionless URL requests to an internal .php file to serve the content, using an internal rewrite.

What happened to the code in post #4501963? I thought that was the rewrite you needed?

There's another problem. If someone were to request the URL and include .php on the end, they would still reach the content, and would be doing so at a Duplicate URL.

To fix that problem you need an additional rule, one that redirects the user to make a new request for the extensionless URL.

Be aware that htaccess does not "make" URLs. If you want a user to "see" and "use" a particular URL, then you must put that URL in the href="" link on the page for them to click on. htaccess kicks in after the link is clicked. htaccess processes the request that the browser makes.


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