- Code: Select all
# 25/08/09
Options +FollowSymlinks
RewriteEngine on
#Redirect from website.com to www.website.com
RewriteCond %{HTTP_HOST} ^website\.com [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301,L]
#Redirect index.php to /
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
#####
# website.com/language to website.com/language/
# website.com/language/ to website.com/default.php?language=language
RewriteRule ^([a-z]+)$ /$1/ [R=301]
RewriteRule ^([a-z]+)/?$ /default.php?language=$1 [L]
# website.com/language/page to website.com/language/page/
# website.com/language/page/ to website.com/default.php?language=language&page=page
RewriteRule ^([a-z]+)/([^/]+)$ /$1/$2/ [R=301]
RewriteRule ^([a-z]+)/([^/]+)/?$ /default.php?language=$1&page=$2 [L]
Works great and passes the language and page values fine.
However when I tried
- Code: Select all
# website.com/language to website.com/language/
# website.com/language/ to website.com/default.php?language=language
RewriteRule ^([^/]+)$ /$1/ [R=301]
RewriteRule ^([^/]+)/?$ /default.php?language=$1 [L]
# website.com/language/page to website.com/language/page/
# website.com/language/page/ to website.com/default.php?language=language&page=page
RewriteRule ^([^/]+)/([^/]+)$ /$1/$2/ [R=301]
RewriteRule ^([^/]+)/([^/]+)/?$ /default.php?language=$1&page=$2 [L]
when requesting anything on the site I got directed to a not found:
http://www.website.com/default.php/?lan ... efault.php
Can anyone tell me what's going on and how I'd fix it for future reference? index.php is the landing page, default.php is going to handle the rest of the site content.
Thanks