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 Link to comment https://forums.phpfreaks.com/topic/17420-mod-rewrite-help/ 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. Link to comment https://forums.phpfreaks.com/topic/17420-mod-rewrite-help/#findComment-74168 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.