aspacecodyssey Posted April 30, 2010 Share Posted April 30, 2010 Hi, I'm doing a simple hiding of ".php" from everything (i.e. www.website.com/subpage will mask to www.website.com/subpage.php). I'm using the following Rewrite rules: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php This has worked for me many many times before. Currently, it's set up at this website: http://www.danbarryfilms.com/ But, as you can see by trying http://www.danbarryfilms.com/resume (which should show http://www.danbarryfilms.com/resume.php), it's not working. However, for some odd reason, if you try http://www.danbarryfilms.com/welcome it will redirect to http://www.danbarryfilms.com/welcome.html -- even though there is no rewrite rule concerning .html files, AND even if there is no .htaccess file present on the server. This is a GoDaddy server...I'm not sure if that means anything. Quote Link to comment https://forums.phpfreaks.com/topic/200235-mod_rewrite-rule-that-normally-worksnot-working/ Share on other sites More sharing options...
cags Posted April 30, 2010 Share Posted April 30, 2010 My only guess is that this is some kind of issue with 'content negotiation'. Quote Link to comment https://forums.phpfreaks.com/topic/200235-mod_rewrite-rule-that-normally-worksnot-working/#findComment-1050931 Share on other sites More sharing options...
aspacecodyssey Posted April 30, 2010 Author Share Posted April 30, 2010 Sorry, I'm not familiar with that -- is there any solution on my end, or would this be all GoDaddy? I've been back and forth with their support team, but they keep insisting it's coding related (though I think they may be doing that because they don't provide coding support, and I've shown them about 15 other sites I've made that use exactly the same rewrite code and work properly). Quote Link to comment https://forums.phpfreaks.com/topic/200235-mod_rewrite-rule-that-normally-worksnot-working/#findComment-1051242 Share on other sites More sharing options...
premiso Posted April 30, 2010 Share Posted April 30, 2010 What seems to be happening is MultiViews is in the virtual hosts <directory> definition. This will attempt to find the file as .html first so it automatically redirects it to .html. This does cause issues have you have just noticed, with re-writing of some URLs. I am not 100% positive that is what is happening, but you can try and turn off the MultiViews in the .htaccess (I never tried it before) or add it to search for .php first and then you would not need the custom rewrite rules. I am not 100% sure on how to do this, but viewing the link Cags posted should lead you to some good information. Googling "MultiViews htaccess" may also yield some good results. Quote Link to comment https://forums.phpfreaks.com/topic/200235-mod_rewrite-rule-that-normally-worksnot-working/#findComment-1051287 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.