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

Biggie in Sub-Folder — Routing Errors #207

Open
eugjlee opened this issue Jan 26, 2017 · 2 comments
Open

Biggie in Sub-Folder — Routing Errors #207

eugjlee opened this issue Jan 26, 2017 · 2 comments

Comments

@eugjlee
Copy link

eugjlee commented Jan 26, 2017

From a fresh clone of this repository - Just changing config.BASE to /biggie/ doesn't seem to work for me. Going through different pages, and refreshing from a specific page will give me routing errors, or telling me index.html is not found on the server.

I mananged to find a solution today with a test, Sub Directory Biggie Test but wondering should it normally work straight out of the box, or is it just my computer fucking up haha.

@baptistebriel
Copy link
Owner

Hello @eugjlee,

It should indeed work from a fresh clone of this repository -- thanks for pointing out the issue.
What did you had to change in the code so it could work on your demo?

Thanks!

@eugjlee
Copy link
Author

eugjlee commented Jan 26, 2017

Hi @baptistebriel

These are the few steps that I made to make it working on my side.

  1. Modified the last RewriteRule on .htaccess

    RewriteRule . biggie-subdirectory/index.html [L]

  2. Route.JS

  e.preventDefault()	

  const target_href = config.BASE.length > 1 ? config.BASE + target.getAttribute('href')  : target.getAttribute('href')

  framework.go(target_href)
  1. Page.JS
  let id = slug(req, options)

  config.BASE.length > 1 ? id = id.replace(config.BASE.substring(1), '') : id
  1. Remove all / from HTML Links from folder Templates. ex :
  <a href="about">About</a>
  1. Add the subdirectory name to the beginning of the javascript/css file in Index.html
  <script src="/biggie-subdirectory/build/app.js"></script

This seemed to work fine with a MAMP server running, then I point browserSync in your gulp/serve.js file to a proxy such as proxy: "http://192.168.0.33/biggie-subdirectory/" to get it working with live reload. It seems okay so far on a live server as well.

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

2 participants