Hi,
I hope that you can help. I have web site which I would like to use friendly URL's and I've got it pretty much working, however there are a couple of pages which aren't displaying correctly.
My .htaccess file has this code:
php_flag display_errors on
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
ErrorDocument 404 /notfound.php
RewriteRule ^news/department/([^/\.]+)/?$ /news/department/index.php?cat=$1 [L]
RewriteRule ^news/year/([^/\.]+)/?$ /news/year/index.php?year=$1 [L]
RewriteRule ^news/([^\.]+)/?$ /news/news.php?newsURL=$1 [L]
The folder and file structure is:
news
index.php
news.php
department
index.php
year
index.php
Example URL's that are working the way I expect would be:
www.mywebsite.com/news/ => goes to /news/index.php
www.mywebsite.com/news/title-of-news-article => goes to /news/index.php?newsURL=title-of-news-article
www.mywebsite.com/news/year/2010 => goes to /news/year/index.php?year=2010
However when I go to the URL www.mywebsite.com/news/year the page displayed is actually /news/news.php and because there is no parameter it shows various error messages. The same happens when going to /news/department/. How can I get it to show the /news/year/index.php page?
I feel sure that there is something that I can change in the rules or do them in a different way, however I have no idea what that could be. Any help you can provide would be much appreciated.