Redirect question using mod_rewrite (no extensions - root of site)
Posted
by alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2010-06-08T14:34:33Z
Indexed on
2010/06/08
14:52 UTC
Read the original article
Hit count: 255
Hi, I'm having a small problem with mod_rewrite
I have the following in my .htacces:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.htm$ index.php?name=$1 [NC]
This is my index.php file:
<?php echo $_GET['name]; ?>
This works great for the following url:
www.mySite.com/this is an example.htm
this would display "this is an example"
What i'm trying to do however, is get it to do the same, without the .htm extension: for example:
www.mySite.com/this is an example
Any ideas?
(dont think it's relevant but i'm using xampp to test this)
© Stack Overflow or respective owner