Mobile app version of vmapp.org
Login or Join
Sarah324

: Cannot allocate resources due to URL rewriting I've a rewrite rule to convert mysite.com/?lang=en to mysite.com/en, but this now gets me into troubles as the referenced files in the .html are

@Sarah324

Posted in: #UrlRewriting

I've a rewrite rule to convert mysite.com/?lang=en to mysite.com/en, but this now gets me into troubles as the referenced files in the .html are relative to parent folder, and now its supossed to be /en/ instead of the root folder, how could I fix it?

PS: I think it has something to do with RewriteCond, but couldn't find the solution yet.

Thanks in advance!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

2 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

Yes, you can use RewriteCond to only do the rewrite for .html files:

RewriteCond %{REQUEST_URI} [.]html$

10% popularity Vote Up Vote Down


 

@Martha676

You have two solutions:


Write the assets in the source code with relative paths (use ../) instead of absolute paths fromt he root.
Move all the assets in some specific folders, such as images, stylesheets, assets... then use mod_rewrite to rewrite /LANG/folder to folder.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme