Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redo missing.php so everything acts off rewrite not ErrorDocument #5

Closed
dlangille opened this issue Oct 4, 2015 · 5 comments
Closed

Comments

@dlangille
Copy link
Contributor

Moved here from dlangille/freshports#5

At present, each port and category uses this method for providing content:

ErrorDocument 404 /missing.php

Let's change that by doing a rewrite to start with so every URL goes to missing.php (for example).

@dlangille
Copy link
Contributor Author

Trying:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /--/index.php/$1 [PT,L,QSA]

Thus, the script at /--/index.php gets everything it needs, but actual files cannot be fetched, e.g. /images/bug.gif

@dlangille
Copy link
Contributor Author

https://www.mediawiki.org/wiki/Manual:Short_URL/Apache was recommended as a starting point. It works better. Now using:

    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/--/index.php [L]

Instead of letting the system check for existing file and directories, it might be easier to just ignore specific files and directories... i.e. less syscalls. This suggestion courtesy of Colin Percival.

@dlangille
Copy link
Contributor Author

This is not yet in production.

@dlangille
Copy link
Contributor Author

Moving to production now...

@dlangille
Copy link
Contributor Author

Now on production. Seems OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant