RewriteCond failing !!!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

RewriteCond failing !!!

Postby devfrombrazil » 17. October 2014 15:38

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 )
devfrombrazil
 
Posts: 2
Joined: 17. October 2014 15:36
Operating System: Windows

Re: RewriteCond failing !!!

Postby Nobbie » 17. October 2014 22:48

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
Nobbie
 
Posts: 8769
Joined: 09. March 2008 13:04

Re: RewriteCond failing !!!

Postby devfrombrazil » 18. October 2014 01:05

It´s precisely the purpouse of my posting here. I have NO CLUE !
devfrombrazil
 
Posts: 2
Joined: 17. October 2014 15:36
Operating System: Windows

Re: RewriteCond failing !!!

Postby Nobbie » 18. October 2014 09:59

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).
Nobbie
 
Posts: 8769
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests