.htaccess RewriteRule not working

Page 1 of 1

0 Replies - 644 Views - Last Post: 01 April 2009 - 08:26 AM

#1 timchase01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-February 09

.htaccess RewriteRule not working

Posted 01 April 2009 - 08:26 AM

Hi All,

I'm hoping someone has some ideas for me. I'm trying to use a RewriteRule in my .htaccess file to change a url from a user friendly version to a version that will return a $_GET array in php.

My .htaccess file has the following.
RewriteEngine on
RewriteBase /htdocs/
RewriteRule ^page/(.*)$ /index.php?var=$1 [L]
RewriteRule ^articles/(.*)$ /articles.php?article=$1 [L]



The first RewriteRule works great. It's the second one that is causing me a problem. If you go to http://www.yourparty....com/articles/7 for example I would expect the rewriterule to change that to http://www.yourparty...s.php?article=7. However, I am not receiving a $_GET array in php. I just get an empty array. I've doing a print_r on the $_GET array to see what it is returning.

If I do the user friendly URL then I get nothing in the array, if I do the articles.php? url manually then I do get the $_GET array.

Does anyone have any ideas as to why the first rewrite rule would work but not the second? Am I just overlooking some silly thing here?

Thanks for any help!!!
Tim

This post has been edited by timchase01: 01 April 2009 - 07:06 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1