Assume .php if no extension specified in url - How?

Discuss practical ways rearrange URLs using mod_rewrite.

Assume .php if no extension specified in url - How?

Postby drewdall » Wed Nov 24, 2004 6:56 am

Good day All,
I have searched for hours, in vain, simply for a way to add ".php" to the end of the filename if no extension is specified, eg.

http://www.example.com/test

should translate to

http://www.example.com/test.php

Can anyone help, please?

Many thanks, in advance, for your valuable time and attention.
drewdall
 
Posts: 1
Joined: Wed Nov 24, 2004 6:50 am

Postby Redprince » Wed Nov 24, 2004 10:56 am

May this:
Code: Select all
RewriteEngine On
RewriteRule (^[^\.]*$) /$1.php
Redprince
 
Posts: 5
Joined: Mon Nov 22, 2004 2:33 am
Location: Salzgitter, Lower Saxony, Germany


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 99 guests

cron