Demio Posted August 13, 2006 Share Posted August 13, 2006 I'm currently using apache 2.0 in my server and I want to make a mod_rewrite rule so that anything that goes to /articles/stuff is redirected to articles.php?codename=stuff but I'm having a hard time.This is my htaccess file:[code]RewriteEngine onRewriteRule ^/articles/([^/.]+)/?$ /articles.php?codename=$1 [L]RewriteRule ^/([^/\.]+)/?$ $1.php [L][/code]Can someone point me to the right way? :D Quote Link to comment Share on other sites More sharing options...
Nexous Posted August 13, 2006 Share Posted August 13, 2006 [code]RewriteEngine onRewriteRule ^/articles/([a-z]+)/ $ /articles.php?codename=$1 [L]RewriteRule ^/([a-z]+)/ $ /$1.php [L][/code]That's how I would do it. Now obviously, that is allowing only a-z not any numbers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.