.htaccess configuration for HTML5 History API - javascript

After several days of digging at the HTML5 History API, I found this great working example that suits my needs https://github.com/pinceladasdaweb/html5-history-api
However, when trying to run it on my local server/web hosting, I get an Internal Server Error, which leads me to think that there's something misconfigured in the .htacccess file.
Looked up at the Apache Error log and confirmed my theory, this was what error line tells:
"[...]
.../html5-history-api-master/.htaccess:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a
module not included in the server configuration"
I'd like to know if I need to make specific configurations in the server to make the example run properly.
You can see a working demo done by the owner here: http://www.pinceladasdaweb.com.br/html5-history-api/
Any help will be really appreciated.
Thanks!

This is what I have done to make it work.
1- As Panama Jack said in the comments, the answer of what was happening was in the log file wamp\logs\apache_error.log
[...] /html5-history-api-master/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
2- I enabled the rewrite_module on my local server (see Hardik Thaker for your visual reply to this post!
3- My web hosting is GoDaddy, I found out that I had to tweak the .htaccess file to make it work. This last post saved my life!
Hope it helps!

Related

Proxy authentification required on script tag REACTJS

First time posting here so don't hesitate if you need/I forgot something. I looked everywhere and didn't find my answer (I guess I'm missing something).
My problem:
I created a REST SpringBoot application and put an index.html in resources/static to create a REACT front end (I don't want to use nodejs, maybe webpack if I really have to).
When I contact localhost:8080/ I end up on my index.html but those scripts:
<script src="https://facebook.com/react-15.2.0.js"></script>
<script src="https://facebook.com/react-dom-15.2.0.js"></script>
needed to make REACT work provoke a Proxy Authentication Required error in the console log.
I am indeed behind my company's proxy. My IDE (IntelliJ) is configured with this proxy. My JVM takes those arguments to make it work:
-Dhttp.proxyHost=myproxy -Dhttp.proxyPort=myport -Dhttp.proxyUser=myuser -Dhttp.proxyPassword=mypwd -Dhttp.proxySet=true
and the application.properties has the following line:
server.use-forwarded-headers=true
I don't know what I should configure anymore to make it work. Do you have any ideas? Thank you very much in advance!
EDIT:
Facebook is a bad example as the proxy won't let me go on this site. I have updated my src to authorized sites (tried them on my browser and they worked). Still, I have the same error: 407 Proxy Authentification Required
I found the solution:
The error is legit. This is the HTTP protocol. First I have the 407 error asking for the informations of my proxy, then those informations are sent throught a second request. Still, showing an error in the log is disturbing.

ExtJS: Empty File Name (only .js?_dc=20181..) - 404 Error

For a long time I keep facing with this problem and unfortunately sencha forums is not helping anything about. Therefore I had to bring up here.
I'm try to developing a simple weather panel. During displaying application on localhost environment it works all good but when it goes to live version it gives this error below and whole application is not working;
GET http://www.myapp/.js?_dc=20180112155627 404 (Not Found)
fetch # (index):89
fetch # (index):99
loadSync # (index):103
load # (index):103
loadEntries # (index):95
processRequest # (index):85
loadSync # (index):85
load # (index):85
As environment we are using Jenkins and classic toolkit during release version and this is Jenkins' commands;
Started by GitLab push by nengin
+ sencha app build classic
I've used Geolocation feature for weather panel but because of this problem I thought it keep raises error so I've take it out but still application keep give this error. On sencha forums they've suggested to me
it happens because of a missing file/ required file. Use sencha app build testing to find out which file is missing. As well comment modern toolkit statements on app.json to avoid errors related with unnecessary classes.
Well.. I did all but still if I'm not disabled weather-panel item on Dashboard class and push it to repository, Jenkins takes commit and build the live version to internet. And keep gives this error above!
Below you will find some code snippets of weather-panel, what could exactly be the reason for this error? I really need some idea.
Here is whole code blocks of weather panel # http://www.text-share.com/view/b53bd4fd
Thanks in advice.
UPDATE
Through #Alexander's comment:
So I've got this WARN on console: [W] [Ext.Loader] Synchronously loading 'Ext.data.proxy.JsonP'; consider adding Ext.require('Ext.data.proxy.JsonP') above Ext.onReady bootstrap.js:867
I've used JsonP on weatherdata class and it doesn't include JsonP inside requires. Now I've added JsonP and now the WARN is gone! So will it run without empty-file error on server with compiled application?
#Alexander 's comment has been the solution;
Please open the browser console, then work with the uncompiled app like it were the compiled app, and check for any occurrences of "Synchronously loading ..., consider adding ..." warnings. Make sure to fix all these warnings, because they cause the issue.

Hosting phono (jquery softphone plugin) dependencies locally?

This may be too obscure a question, but perhaps someone can spot what I'm doing wrong.
Phono (jquery plugin for javascript/flash-based softphone built on top of Tropo/Voxeo) loads a couple of dependencies from the phono.com servers. Namely,
flensed.js
checkplayer.js
swfobject.js
phono.audio.swf
I would very much like to avoid loading these dependencies from an external server (for obvious reasons) and going by this thread on their forums (which I can't register for because it appears every possible username has been "taken") , it should be possible to host them locally.
Here's a prettified source for the main jquery plugin. Maybe I'm just bad at looking, but I could not find a commented, un-minified version either in their full SDK or on github.
So after changing
base_path: "http://s.phono.com/deps/flensed/1.0/"
and
swf: "http://s.phono.com/releases/" + Phono.version + "/plugins/audio/phono.audio.swf"
... all dependencies seem to load just fine, phono successfully grabs a session ID and chats by SIP appear to be working. When I try to dial out or call the session id/SIP, however, I get a javascript error:
Uncaught TypeError: Cannot call method 'start' of null
referring to line 770 : h.start().
this.$flash.play(g, j); appears to return null or undefined. I suck at javascript and can't figure out why.
EDIT - if anyone would be so adventurous as to try this out, you can just grab their "kitchen sink" demo and slap it up on a server without much hassle.
Okay -- this is ridiculous and I'm an idiot for not catching it sooner.
Flash was trying to load the ringtones off my server at the URL that requires authentication. Unfortunately, flash is not a user with a valid session. Hence, flash was grabbing big handful of nothing. Sorry.
You can download the PhonoSDK and all of the samples (including the kitchen sink demo) and run it on your localhost. Here's the link: http://s.phono.com/releases/PhonoSDK-0.2.zip. It's open source, do you can also fork/contribute to the project as well - https://github.com/phono
I just tried it using Apache on my localhost it worked without editing anything.

'Sys is undefined' error javascript error

I've tried every solution I've found through Google, and I'm currently at a loss.
I have several projects which were created for .Net 2.0 and IIS6 Server 2003 32 bit, and are being migrated to IIS7 Server 2008 64 bit (I'm new to both IIS7 and Server '08). Right now any page that utilizes .Net AJAX is getting this 'Sys is undefined error' after migration. When I view source and try to view any *.axd file, I get a 404.
I've checked that my web.config has all the appropriate sections., with all "Version" attributes set to 1.0.61025.0 since I'm not currently upgrading from .Net 2.0. The Virtual Directories are created as applications, and the App Pool is set to .Net 2.0 Integrated.
I've checked that the *.axd Handler Mappings are there and set to "Unspecified Path Type". Also there are the appropriate *_AppService.axd and ScriptResource.axd mappings.
I'm not making any custom javascript references to Sys.
I've already tried repairing/reinstalling .Net on the server, and running aspnet_regiis via the command line.
I've also tried creating "blank" WebResource.axd and ScriptResource.axd files to put them in the project. While they eliminate the 'Sys is undefined' error, it also breaks functionality within any page looking for that file.
Do I have any other options? Did I miss something else, or did I make a mistake in the steps I've already taken? Any insight you guys could provide is much appreciated. Thanks!
Removing the ScriptResource.axd Handler mapping resolved my problem once.
Also we had done this at that time,
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
Hope that helps you out (^.^)

Apache "undefined" file requested

I am having an interesting error with Apache (I think Apache is the issue). I noticed many of my JavaScript files were not being served. When I went and looked at my Apache logs, I saw a whole slew of:
.... [error] File not found: /webroot/site/undefined .....
I have a strange feeling the issues are related. I am requesting the correct script src paths for sure.
Any reason why the heck "undefined" would be requested?
Additional info: PHP script, clients are embedded IE8 applications.
If you really do call the correct script URIs (“script src paths” as you say) the problem can only lie in your apache configuration.
Check your rewrite rules etc.
You may also want to check your access log, whether strange/wrong paths/URLs were called.

Categories

Resources