JonShipman
JonShipman

Reputation: 675

Htaccess RewriteCond taking me to 404 - folder exists

I have two htaccess rewrite conditions:

RewriteCond %{HTTP_HOST} ^(www\.)?gotham.rentals$
RewriteRule !^gothamrentals/ /gothamrentals%{REQUEST_URI}  [L]

RewriteCond %{HTTP_HOST} ^(www\.)?sofla.biz$
RewriteRule !^southflorida/ /southflorida%{REQUEST_URI}  [L]

The first one works, the second one does not (404 from the server). What gives? The folder southflorida exists and has the same permissions as the folder gothamrentals.

Upvotes: 0

Views: 64

Answers (1)

JonShipman
JonShipman

Reputation: 675

The answer I used was adding:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

To the southflorida directory. I suspect, maybe "/" was getting added to the url and the child htaccess was taking care of gothamrentals.

Upvotes: 1

Related Questions