matfish Posted May 26, 2010 Share Posted May 26, 2010 Hi there, I've recently moved server and it seems to be working differently. Not sure if anyone knows the reason I can change on the server (it's dedicated so I can change) to save changing my site structure... I have a rewriterule of the following: RewriteRule ^blog/([^/]+)$ /blog/blog_detail.php?rewrite=$1 [L,NC] which gives me "nice URLs" but now the directory /blog/index.php doesn't work? It's like index.php is being passed as the rewrite=$1 variable... Did that make sense? Any help would be appreciated. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/202947-directories-and-rewrite-rules/ Share on other sites More sharing options...
trq Posted May 26, 2010 Share Posted May 26, 2010 It's like index.php is being passed as the rewrite=$1 variable... Which is exactly what your rewrite rule does. Quote Link to comment https://forums.phpfreaks.com/topic/202947-directories-and-rewrite-rules/#findComment-1063508 Share on other sites More sharing options...
matfish Posted May 26, 2010 Author Share Posted May 26, 2010 Hmm, this didn't happen on my old server, it's only happened since the server move. Any idea's why or how to overcome this now? Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/202947-directories-and-rewrite-rules/#findComment-1063512 Share on other sites More sharing options...
matfish Posted May 26, 2010 Author Share Posted May 26, 2010 I guess if I change it to: RewriteRule ^blog/([^/]+)/$ /blog/blog_detail.php?rewrite=$1 [L,NC] instead this will fix it but I will end up with a trailing slash #selfanswered Quote Link to comment https://forums.phpfreaks.com/topic/202947-directories-and-rewrite-rules/#findComment-1063518 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.