Forum Moderators: phranque
RewriteRule ^articles/(.*)/(.*)/(.*)/(.*)$ index.php?page=viewarticle&y=$1&m=$2&d=$3&t=$4 RedirectMatch ^/$ http://mysite.com/home/ Put simply, if I rewrite, /index.php?page=news&title=somenews to /news/somenews/
example.com/news/somenews/ and rewrites it to fetch content from the server filepath at /index.php and passes the parameters page=news&title=somenews to that resource. ^([^/]+)/([^/]+)/([^/]+)/([^/.]+)$ may work a lot better. I want /home and /home/ to both be allowed and point to the same file
:: memo to self: add MultiViews to list of things my host does by default ::Do you mean turn it on? If so, don't turn it on. It does not play nice with Mod_Rewrite and is a source of endless Duplicate Content.
mod_rewrite which in turn is processed before mod_aliasCorrect operation should be mod_alias before mod_rewrite.
Next, when mod_rewrite runs, it takes that pointer and uses it as a part of the new URL and then exposes it out on to the web in the Location part of the HTTP header of the redirect.
When mod_rewrite runs before mod_alias you end up with problems. An incoming URL request is rewritten to an internal path by the mod_rewrite RewriteRule and the internal pointer is updated. Next, when mod_alias runs, it takes that pointer and uses it as a part of the new URL and then exposes it out on to the web in the Location part of the HTTP header of the redirect.