Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Relative URL's to assets #3

Closed
xeoncross opened this issue Apr 2, 2012 · 6 comments
Closed

Relative URL's to assets #3

xeoncross opened this issue Apr 2, 2012 · 6 comments
Labels

Comments

@xeoncross
Copy link

Rather than pointing to something like app/assets/js/app.js Laravel seems to be creating links like http://tinyissue.loc/project/app/assets/js/app.js which includes an extra "project" folder in front of the path. On other pages it looks like http://tinyissue.loc/index.php/administration/app/assets/js/app.js.

In other words, it always appends the current URL path to the location when Asset::styles() is called. I assume this is just a Laravel 1.0 bug.

I'm using Nginx and so it might not like the $_SERVER['REQUEST_URI'] that nginx provides or something.

@xeoncross
Copy link
Author

Yep, seems that Laravel/URL tries to use Config::$items['application']['url'] and if it's not set then it uses $_SERVER['SCRIPT_NAME'] which isn't the same on Nginx as it is Apache.

@mikelbring
Copy link
Owner

That's possibile, I didn't test this on Nginx. I plan to rewrite a lot of the routes to controllers to the new Laravel, hopefully this week, this problem might be fixed in 3.0. Thanks for bringing this up.

@mikelbring
Copy link
Owner

This is sorta a temporary fix, but in app/application/config/application.php under the url option, try to define your full url and see if that helps with the relative path issue.

@mikelbring
Copy link
Owner

Please checkout the develop branch, it is completely in Laravel 3.1.4, see if it fixes your issue. You may find other bugs, I litterly spent the last few hours converting it all over and I am sure something might be broken :). You may still need to define your URL, which you can do in the config file now. I think you only need to define the URL if you are on a non-apache setup.

@xeoncross
Copy link
Author

Thanks a lot for the help. I was able to get it working and I would like to see if I can add anything to this project - but first I have to convince my team to give it a try over ahem the issue tracker we are using right now. :P

@mikelbring
Copy link
Owner

Awesome! I don't really have any long term ideas or plans for the project, my goal was to keep it pretty simple but refine it and make it better. If you have any feature ideas or refinement send them over a "issue" and we can talk, this is my first dealings with managing a open source project! I am going to close this issue. Thanks!

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

No branches or pull requests

2 participants