Forum Moderators: phranque

Message Too Old, No Replies

.htaccess adding .html or .php automatically.

Getting the browser to go to a page even without extension.

         

ashj

8:03 pm on Aug 29, 2009 (gmt 0)

10+ Year Member



At the moment I'm using:

Rewritecond %{REQUEST_URI} !\.[^/]+$
Rewriterule (.+) $1.html [L]

To add .html to the end of a request so that if you don't put .html you won't get a 404. Is there a way of having a more targeted one, so that every request for ".../blog/something" automatically has .php added instead of html?

I'm really not sure how to do it.

jdMorgan

9:21 pm on Aug 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you asking about *adding* a more-specific but similar function for URL-paths beginning with "/blog/" or modifying this one? What is the "big picture" of the solution you're seeking, and what have you tried so far?

Jim

ashj

9:36 pm on Aug 29, 2009 (gmt 0)

10+ Year Member



Sorry, I've managed to just put a different .htaccess in the /blog/ directory which seems to be fine now. Thanks for responding anyway though.