Giter VIP home page Giter VIP logo

Comments (7)

dzuelke avatar dzuelke commented on September 28, 2024 1

The "some reason" can be found in heroku logs, because Apache will tell you what's wrong with the file!

from heroku-buildpack-php.

njandreasson avatar njandreasson commented on September 28, 2024

I'm using .htaccess and mod_rewrite with success using the buildpack, however it's not working for files suffixed with .php as I detailed in #46
Are you perhaps facing the same issue as me?

from heroku-buildpack-php.

katmai avatar katmai commented on September 28, 2024
AddType text/x-component .htc
RewriteEngine On
RewriteBase /

### Canonicalize codeigniter URLs

# If your default controller is something other than
# "welcome" you should probably change this
RewriteRule ^(index(/index)?|index(\.php)?)/?$ / [L,R=301]
RewriteRule ^(.*)/index/?$ $1 [L,R=301]

# Removes trailing slashes (prevents SEO duplicate content issues)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

###

# Removes access to the system folder by users.
# Additionally this will allow you to create a System.php controller,
# previously this would not have been possible.
# 'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

<IfModule !mod_rewrite.c>

# Without mod_rewrite, route 404's to the front controller
ErrorDocument 404 /index.php

this is my .htaccess

from heroku-buildpack-php.

katmai avatar katmai commented on September 28, 2024

I think i might be. It doesn't redirect to my index.php file, and CI is erroring out.

This is what i have in my app folder.

application composer.json composer.lock index.php Procfile public system vendor x.txt

from heroku-buildpack-php.

dzuelke avatar dzuelke commented on September 28, 2024

Confirmed it's a problem, working on a fix. Thanks for bringing this to our attention!

from heroku-buildpack-php.

dzuelke avatar dzuelke commented on September 28, 2024

Fixed in 14092f9. Caveat: it is currently not possible to rewrite .php URLs that point to files that actually exist. This is due to how we use rewrites (rather than the much inferior ProxyPassMatch approach) to hand requests over to mod_proxy_fcgi. Currently working with upstream on a better (SetHander based) approach.

from heroku-buildpack-php.

Bluscream avatar Bluscream commented on September 28, 2024

Can't use this .htaccess file for some reason :/ https://github.com/Wruczek/ts-website/blob/1.0/.htaccess

from heroku-buildpack-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.