I have files in my root folder. jobs.php
, contact.php
.
I want to be able to use .htaccess to remove the .php
extension and force a trailing slash /
. So that, www.domain.com/jobs/
and www.domain.com/contact/
goes to their respective pages.
Also, I want jobs.domain.com
to point to www.domain.com/jobs/
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteRule ^(rosquillos)/$ $1 [L,R=301,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
</IfModule>
This is what I've got so far, and as much as I try. I can't seem to get it to work.
Any help would be awesome.
EDIT:
I would like to rephrase my question. The existing code removes the .php
extensions for me, what I really only need right now is an additional rule that points the subdomain to the correct file: ie. jobs.domain.com
points to jobs.php. I can live without the trailing slash.