Forum Moderators: phranque
I've been browsing some threads at WebmasterWorld, but didn't find the right rule to perform what I'm trying to do.
I want to make [mysite.com...] --> [mysite.com...]
but not redirecting but masking the URL (the first URL must be shown and not the second one).
My .httaccess:
--------------------------
RewriteEngine On
RewriteBase /
DirectoryIndex index.php index.html
RewriteRule ^post/(.*).htm post.php?id=$1 [R=301,L]
---------------------------
I also tried with:
RewriteRule ^post/(.*).htm post.php?id=$1 **whithout R,L**
I got this URL: [mysite.com...]
I also tried with
RewriteRule ^post/(.*).htm post.php?id=$1 [L]
I got this URL: [mysite.com...]
I also tried with
RewriteRule ^post/(.*).htm [mysite.com...] [L]
I got this URL: [mysite.com...]
Any suggestion?
I also tried with
RewriteRule ^post/(.*).htm post.php?id=$1 [L]
I got this URL: [mysite.com...]this looks like the correct rule for an internal rewrite.
isn't this what you wanted?other than that, the ".*" in your regexp is considered "ambiguous, greedy and promiscuous", so it might be better to use something more efficient like "[^.]*"
or perhaps "[0-9]*" if appropriate.