Page 1 of 1

RewriteCond failing !!!

PostPosted: 17. October 2014 15:38
by devfrombrazil
hey I need a condition + rule like this: wheter I go to www.example.com it serves me index.php but otherwise if I go to www.example.com/my-article it points me out to show_post.php?url=$1

I´ve tried this: http://apaste.info/6i2 . Please note RewriteRule ^viewpost-([^/]*)$ show_post.php?url=$1 [L] is just a workaround and not my final intention ( it works when I request www.example.com/viewpost-my-article but my intention is www.example.com/my-article )

Re: RewriteCond failing !!!

PostPosted: 17. October 2014 22:48
by Nobbie
devfrombrazil wrote:Please note RewriteRule ^viewpost-([^/]*)$ show_post.php?url=$1 [L] is just a workaround and not my final intention ( it works when I request http://www.example.com/viewpost-my-article but my intention is http://www.example.com/my-article )


So you need only to adapt the code to your needs. For any further questions, simply visit the official documentation of mod_rewrite: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Re: RewriteCond failing !!!

PostPosted: 18. October 2014 01:05
by devfrombrazil
It´s precisely the purpouse of my posting here. I have NO CLUE !

Re: RewriteCond failing !!!

PostPosted: 18. October 2014 09:59
by Nobbie
devfrombrazil wrote:It´s precisely the purpouse of my posting here. I have NO CLUE !


It's precisely the purpose of my answer, read a documentation and get a CLUE. Like i did (for example).