micah1701 Posted February 27, 2008 Share Posted February 27, 2008 I've used mod rewrite a few times in the past for sites to have nice pretty SEO URL's. Here's my current situation though, I want: domain.com/news/2008/02/27/name to really be: domain.com/news/?year=2008&month=02&day=27&title=name I think I know how to do that but here's my problem: This dynamic url is actually replacing a legacy system which used actual HTML files in sub folders. So while i want the mod rewrite to work for all new links created, I still need the site to be smart enough to check if a file actually exists at the URL and show that file instead of using the cute new link. thoughts on how to handle this? Quote Link to comment https://forums.phpfreaks.com/topic/93404-clean-url-but-what-if-a-file-actually-exists/ Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 You would simply add some conditions prior to your rules such as.... RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Quote Link to comment https://forums.phpfreaks.com/topic/93404-clean-url-but-what-if-a-file-actually-exists/#findComment-478796 Share on other sites More sharing options...
micah1701 Posted February 28, 2008 Author Share Posted February 28, 2008 Brilliant! you've helped me once again thorpe. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/93404-clean-url-but-what-if-a-file-actually-exists/#findComment-479036 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.