importing CSS <link> property is not working on server - css

I kept all my .css files in a folder . I am importing it on my aspx page
.
when I am running it on localhost it is working fine but when i am hosting it on server it is not working . When I am declaring on each aspx page and rewriting the same css file it working fine . Now the question why it is not importing the file on server on localhost it is working fine .

To solve problems like this, we should use relative paths while specifying the url. We have faced the similar issues and it was because of not having relative paths. This link may help you. Please post your code snippet to help me understand further.
To understand relative paths click here.

I had a problem with my hosting server not reaching the proper files even though they are imported successfully. What I did was backed up the files, deleted them and replaced them with the backup. I added ../ before all the folders in the links to get to the root folder, then I navigated to the css folder from there, and it worked. It may have something to do with the root dir being different. If it works great, if not oh well.

Its a mismatch of the url, somehow it's not getting the file in the place it should. Try Rewriting the code again, sometimes it helps.
If it doesn't work send the code.

Related

Laravel Mix - URL Processing works wrong when web site on localhost is not in root folder

Web server structure:
localhost/my_site_folder/public
When I am using url(../images/example.png) in my scss file, mix automatically finds example.png, copy it to my public/images folder, and then rewrites the url() within my generated stylesheet (https://laravel.com/docs/5.6/mix#url-processing)
Cool feature and everything seems fine, except fact, that link was generated as it was described in docs background: url(/images/example.png?d41d8cd98f00b204e9800998ecf8427e);, but in my case this link is to localhost/images/example.png?d41d8cd98f00b204e9800998ecf8427e but I need to localhost/my_site_folder/public/images/example.png?d41d8cd98f00b204e9800998ecf8427e.
And I can't find where I could setup my website root folder path.
P.S. for example, in laravel it could be done via .env file APP_URL=http://localhost/my_site_folder/public
Is there is something similar in mix?
This do the trick mix.setResourceRoot("../").
Thanks to Namoshek comment.
maybe
php artisan storage:link
will be the answer?
https://laravel.com/docs/5.6/filesystem

Typo3 files not found

I have set up a Typo3 project and I am using the Bootstrap Kickstart Package extension. So far everything works, but for example the CSS files are not loaded (see screenshot). If I call the paths in Explorer, all files are available. Can someone here help me?
Do you use the .htaccess of TYPO3? You can find it in the typo3_src folder and move it to your root directory. Without it, the timestamps of the files ?12345 will be interpreted wrong.
Seems it could not get a proper path to the assets. Please check your baseUrl and absRefPrefix
in the setup ts. Check property below:
config.baseURL = http://localhost/project/
config.absRefPrefix = project/
Generally, absRefPrefix required in the local server it does not require at the live server.
Second possibility permission issue, please check directory permission.
Hope this helps you!
Greetings!

urls for images in meteor

I've recently switched from PHP to JS Meteor+ReactJS. I've started my first project and almost instantly got a bump in the road.
I cannot seem to get image in my scss file to work. Same with trying to get to it via url in my browser. In the browser I get flow-router error about missing path. Scss doesn't give me any errors just doesn't work.
I've tried every possible link variation I've found online.
absolute_path, relative_path, {}absolute_path, {}relative_path, even just putting the image in the same directory as the scss and linking to it in the same directory. Nothing seems to work.
I'd greatly appreciate any help.
Put images and other shared content for the client in your project's public directory. public gets mapped to / so you can refer to them with <img src='/images/mypicture.png'>
If you want an images directory then put them in public/images and refer to them as <img src='/images/mypicture.png'>

external CSS sheet not loading to hosting

I'm having trouble making my CSS external stylesheet work in my actual hosting. It all works fine when I open the files from my Finder (I'm using a mac), but the stylesheet does not seem to load to my server properly. All other html files load fine and are visible when you visit my website in any browser,this is my website and the File Manager on my cPanel indicates that the CSS folder and external stylesheet file have been successfully uploaded for enough time that the style features should display. I tried clearing my browsing history and reopening my browser.
My link tag is and I have tried it using aswell as with just "css/socialpolarities.css". I've checked to make sure the spelling is right on the path and corresponds to the actual file.
Is the answer to just put all the style files in the public_html folder and then just change the path on all my html files? Or am I missing something?
I'm also using LiquidWeb if that means anything
The file css/socialpolarities.css seems to exist, but is void of content.
try looking at your local file to make sure it is indeed the one with the css code, then upload it to the same folder and override the original one.
You may have had an upload error.
I got it! The problem was actually that I needed to put the css file in the home directory, for some strange reason. My path from my html files definitely specified that the css files were in a css directory so I'm not sure if it's something I did wrong or whether the cPanel just sucks. Regardless, it works so I won't mess with it. Now time to copy all of my webfont files into my home directory...this is going to be messy lol.
Check your permission. They should be 755. You can search about permissions on internet. I changed the permissions and it worked fine.

File not found error in Asp.net 4.0

On Local host,my solution works fine but on server when i deploy ,it gives that file not found error. and the error message is something like this.http://localhost:27375/favicon.ico
I don't have any such file in my application.I tried to create on in the root folder but no luck.any help is highly appreciated
Your favicon.ico file should be in your root directory for the web site.
It looks like your application is still trying to connect to the localhost in order to display the favicon. Are you hard-coding your URL to the favicon with a http://localhost:27275/favico.ico address?
To build on what Internet Engineer said, using ASP.NET, you can use a relative path prefaced with ~ or /. So, you can use ~/favico.ico or /favico.ico in order to reference your icon file.
First check in web server if you can see the file directly in the browser:
http://productionwebsite/favico.ico
If the file is there, now you need to check that the code is using relative paths. Most likely this is coded using absolute paths.

Resources