[SOLVED] mod_rewrite file extension

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
miniuzi
Forum Newbie
Posts: 2
Joined: Mon Mar 14, 2005 2:33 pm

[SOLVED] mod_rewrite file extension

Post by miniuzi »

I am trying to make the file foo.php or foo.html redirect to foo

I have tired:

Code: Select all

RewriteEngine on
RewriteRule ^(.*)\.(.*)$ $1

Code: Select all

RewriteEngine on
RewriteRule ^(.*).(.*)$ $1
Can someone please help me?
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

i have to admit., that's one of the most interesting questions i've seen in a while, simply because i didn't even know apache could do this.

anyways, i found 4 great links that you should check out.

This one shows basically exactly how to do what you are wanting... Hope it helps out :
URL = http://scribbling.net/how_scribblingnet ... ternal_ids



This one kinda shows how to do it but by removing the entire filename...

URL = http://www.pmwiki.org/wiki/Cookbook/CleanUrls


This one came off apache's site. It mainly gives you all the methods of writing a mod_rewrite...

URL = http://httpd.apache.org/docs/misc/rewriteguide.html


This last one is an online tutorial i found quite interestnig to read. Might help you out a little too...

URL = http://www.workingwith.me.uk/articles/s ... d_rewrite/
miniuzi
Forum Newbie
Posts: 2
Joined: Mon Mar 14, 2005 2:33 pm

Post by miniuzi »

This did the trick:

Code: Select all

RewriteBase / 
RewriteCond %{REQUEST_URI} ^/.*\.html$
RewriteRule ^(.*)\.html /$1  їR,L]
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

hi there...
i m very new to apache!!!!!
me too want some help in url rewriting can any one help me????
Post Reply