Hey All! I am trying to configure mod_rewrite such that I can access php scripts without showing the .php extension (/mysite/ calls /mysite.php). After finding a tutorial online, I was able to achieve this. However, I noticed that this is not working for subdomains that I create on my website. Here is the .htaccess file that I am using: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^/]+)/$ $1.php I have dropped this file into the subdomain's root folder, however I am getting 404 errors. Can anyone help decipher that regular expression and then suggest any modifications I would need to make for the subdomain? Thank you all in advance!
If you can change the Apache virtualhost settings you can activate MultiViews, then you don't need any rewrites; it works default then. However, you are almost there; this should work; RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)/$ $1.php
Thanks for the reply, wpconfig. I tried adding a .htaccess file to my subdomain directory and I am still getting a 404 error. Can I even use a .htaccess file in the subdomain or do I need to add that to the .htaccess file in the root of my hosting? My hosting is configured as followed /html/ --websites stuff goes here /html/subdomain/--subdomain stuff goes here Thanks again for your help