Jump to content

Rewrite ALL pages to Index - Kils all JavaScript


unemployment

Recommended Posts

Make it only rewrite if the requested file doesn't exist. Before the RewriteRule put

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

 

That fixed the script errors I was having but this isn't exactly functioning perfectly.  Right now if I go to index it works great and if I use Javascript (Backbone.js) to load my next view and navigate to the next page with the HTML5 History API, that works.  The problem is when loading a page that has a query string.  For instance, if I go to index/login, the page redirect back to index and then my JS will load the login view.  This is not what I want to have happen.  It is essentially causing the screen to flicker since it loads the index first and then the JS view.  Not sure how to solve this.

 

Link to comment
Share on other sites

That sounds far more likely to be a JavaScript issue.

 

Yeah... I'm actually changing my approach.  I was originally think I'd build a single page app, but not I think getting SEO benefit from that is just going to too difficult.  I decided on a hybrid approach where I will only use backbone to render application pages and have other pages be generated by PHP

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.