Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mod Rewrite For Subdomain

Status
Not open for further replies.

mateobus

Programmer
Aug 20, 2007
28
US
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top