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

outline_javascript generating broken links #238

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 6 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

What steps will reproduce the problem?

Occurs when mod_rewrite makes the document appear to be in a different 
directory and JavaScript is being 'outlined'.
e.g. RewriteRule ^([-a-z]+)/$ /scripts/category.html?shortname=$1

What is the expected output? What do you see instead?

The <script> src generated by the outline_javascript filter is only valid from 
the directory where the script is located.  From the re-written path the link 
is broken (404).

What version of the product are you using (please check X-Mod-Pagespeed
header)?
0.9.16.6-r555

On what operating system?
Debian GNU/Linux

Which version of Apache?
2.2.16

Which MPM?
    ModPagespeedDisableFilters inline_css,inline_javascript
    ModPagespeedEnableFilters move_css_to_head
    ModPagespeedEnableFilters rewrite_css,rewrite_javascript
    ModPagespeedEnableFilters outline_css,outline_javascript

Please provide any additional information below, especially a URL or an
HTML file that exhibits the problem.

http://www.capitalwines.com.au/ministry/
<script type="text/javascript" 
src="_,Mjo.KT-QvufXb4.js.pagespeed.jm.0nrvg_cYUr.js"></script>
link returns 404 Not Found.

http://www.capitalwines.com.au/scripts/category.html?shortname=ministry
<script type="text/javascript" 
src="_,Mjo.KT-QvufXb4.js.pagespeed.jm.0nrvg_cYUr.js"></script>
link works as expected.

So the outlined javascript only works when sourced from:
http://www.capitalwines.com.au/scripts/_,Mjo.KT-QvufXb4.js.pagespeed.jm.0nrvg_cY
Ur.js

But it is instead being sourced from (e.g.):
http://www.capitalwines.com.au/ministry/_,Mjo.KT-QvufXb4.js.pagespeed.jm.0nrvg_c
YUr.js

This behaviour appears to have started with the upgrade to 0.9.16 (not 
confirmed).

Original issue reported on code.google.com by dun...@chirp.com.au on 14 Mar 2011 at 10:04

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

[deleted comment]
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Update: resolved by disabling trim_urls:
<script type="text/javascript" 
src="http://www.capitalwines.com.au/scripts/_,Mjo.KT-QvufXb4.js.pagespeed.jm.0nr
vg_cYUr.js"></script>

Original comment by dun...@chirp.com.au on 14 Mar 2011 at 10:22

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Disabling trim_urls fixed a drupal install for me, users couldn't add content 
anymore because urls got rewritten from domain.com/node/story/add to 
domain.com/node/node/story/add.

Drupal uses mod_rewrite for it's clean url option.

This was after upgrading from a previous release to the latest beta (r555)

Original comment by dale.hof...@gmail.com on 14 Mar 2011 at 11:40

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

We are hot on the trails of a fix.  Please stay tuned.

Original comment by jmara...@google.com on 14 Mar 2011 at 2:23

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 14 Mar 2011 at 2:23

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Fixed in 0.9.16.9

Original comment by jmara...@google.com on 17 Mar 2011 at 12:23

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment