Forum Moderators: phranque

Message Too Old, No Replies

.htaccess problems

.htaccess

         

rike

12:05 am on Jun 18, 2010 (gmt 0)

10+ Year Member



I've put a website designed by another company on the host that I use, It worked fine on the other host but now i've ported it across it just shows the folder structure in the browser because no file named index was used, instead it redirected to a file called content.php using the .htaccess file as shown below.

Why won't this .htacces script work on the new server?

AddOutputFilterByType DEFLATE text/html text/css text/javascript


DirectoryIndex content.php?_page=index

ExpiresActive On
ExpiresByType image/jpg A604800
ExpiresByType image/jpeg A604800
ExpiresByType image/gif A604800
ExpiresByType text/javascript A2592000
ExpiresByType text/css A2592000

#
RewriteEngine On
# force www.site
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

#content pages
RewriteRule ^(content|index|news|track|championships|events|about|history|buysell|private|accommodation|sponsors|links).html$ /content.php?_page=$1 [L]
#RewriteRule ^(contact).html$ /contact.php?_page=$1 [L]


#admin
RewriteRule ^(content|index|news|track|championships|events|about|history|buysell|private|accommodation|sponsors|links|contact)admin.html$ /contentadmin.php?_page=$1 [L]

#logout
#RewriteRule ^logout$ /artistentry.php?logout=1 [L]

RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com [NC]
RewriteRule \.(gif|jpe?g|png)$ - [F]

[edited by: jdMorgan at 3:05 am (utc) on Jun 18, 2010]
[edit reason] example.com [/edit]

jdMorgan

3:10 am on Jun 18, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try
 Options -MultiViews 

and
 AcceptPathInfo off 

for starters.

Also, escape all literal periods in patterns, e.g. "page\.html"

Jim