PiTheNumber
PiTheNumber

Reputation: 23542

Apache rewrite: if not exists in /public open as /public/index.php/

I want

  1. http://kemtime2_neu.pr.domain.de/css/style.css to open as http://kemtime2_neu.pr.domain.de/public/css/style.css and
  2. http://kemtime2_neu.pr.domain.de/login to open as http://kemtime2_neu.pr.domain.de/public/index.php/login

I have

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public/index.php/$1 [L]

This works for 2.

How do I make it work for 1.? Note that I can not change the document root (sorry!).

Upvotes: 1

Views: 2702

Answers (2)

PiTheNumber
PiTheNumber

Reputation: 23542

Found it:

# Redirect to static content
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond /var/www/de/domain/pr/kemtime2_neu/public%{REQUEST_URI} -f
RewriteRule ^(.+)$ /public/$1 [L]

# otherwise redirect to script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public/index.php/$1 [L]

Upvotes: 2

djc
djc

Reputation: 11711

Change your DocumentRoot to point to the public directory?

Upvotes: 0

Related Questions