Prevent URL rewrite from changes underlying links to static files - url-rewriting

I am new to Tuckey's URLRewriteFilter, so I am trying this thing.
In my project I got URLS like index.cfm?action=management.start.home. I want to rewrite those to management/start/home.
So I wrote following filter:
<rule>
<from>/management/start/home</from>
<to type="redirect">/index.cfm?action=management.start.home</to>
</rule>
It works quite well, as the content from given url is shown. But I stumbled upon one problem. all my links to static sources has been changed as well.
All the links got the management/start/ piece included. EG:
public/js/company/jquery.company.button.js
management/start/public/js/company/jquery.company.button.js
I can't find the information to fix it at the Manual...

The reason it changed was that the links were dynamic. So I changed public/js/company/jquery.company.button.js to /public/js/company/jquery.company.button.js and everything work as expected.

Related

See parameters that are overridden from TeamCity template

Is there a way to see TeamCity configurations that override parameter defined in template?
I don't think so. What's worked for me in the past was to search through the project files on the filesystem. If you have many build configs, this will be faster than opening each of them in the GUI.
Search for something like this:
<param name="myParamInheritedFromTemplate" value="myOverrideValue" />
in <TeamCity data directory>/config/projects/**/*.xml. If it's absent in an XML file, that build config just inherits the value. If it's present, it overrides it.
It's hacky but it's quick.
There is a feature request https://youtrack.jetbrains.com/issue/TW-21212, please vote. Current workaround are to either search the raw XML files with the settings stored under TeamCity Data Directory on the server as #sferencik suggested, or use REST API to get settings of all the build configurations and search for the parameter there. Let me know if you need help on any of these.

How Can I edit magento Rewrite.php to keep get parameters

I have the same issue described here: Magento URL Rewrite Management preserve GET parameters
Which kind of changes should I do to Rewrite.php? Is there any other way to make it work in general without changing rewrite.php?
Build the urls like:
$this->getUrl("*/controller/action", array('param1'=>value, '_current'=>true));
The value '_current'=>true will keep your current params in the new URL

Bing API Azure Marketplace: how to know whether there are more results?

I am using the Bing Search API in Windows Azure Marketplace (i.e., the API that replaces the old Bing 2.0 API, that expires on 1st August 2012). The Migration Guide provided by Microsoft states:
If there are no more pages of results, the /feed/link[#rel=’next’] property will no longer appear [...].
However, it seems that this is not always the case. For example, a News query for "Roger Federer" does not contain a link element:
Request: https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query=%27"Roger+Federer"%27
Response:
<feed xmlns:base="https://api.datamarket.azure.com/Data.ashx/Bing/Search/News"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom">
<title type="text">"Roger Federer"</title>
<subtitle type="text">Bing News Search</subtitle>
<id>https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query='"Roger Federer"'</id>
<rights type="text"/>
<updated>2012-07-26T15:43:03Z</updated>
<entry>
<!-- ... -->
</entry>
<!-- ... -->
</feed>
Nevertheless, there are more news: https://api.datamarket.azure.com/Data.ashx/Bing/Search/News?Query=%27"Roger+Federer"%27&$skip=50
Does anybody know where the problem might be? (Or where there is reliable documentation for the API?)
One thing to do is to update your BingSearchContainer.cs - I found there was an older version when I first started using it that caused me all sorts of problems like this. When I updated a lot of things started working.
I think the problem is that the BingSearchContainer is "fixing" your query and messing you up. Try the following:
Then try to do the query without the " marks. It will probably succeed and return results.
Try to use ' instead, you will probably get some results.
I think the container is escaping all your queries as a single phrase match by default. So just adding a search will work. Now when you really do have two phrases you need to search for... That I can't get working yet either.
I cannot reproduce this anymore: the response now contains a link element.
I suppose the Bing guys have fixed the problem in the meantime.

Url routing in elgg

I am trying to create a social network application using elgg.Since i am pretty new to elgg i like know whether i can define url routing like in cakePHP
I need the url like this
mydomain.com/username instead of mydomin.com/pg/profile/username
Is there any way that i can avoid /pg/ and /mod/ from the urls??
I am using elgg version 1.7.8.
I am not interested in url rewriting with .htaccess.
Thanks in advance
elgg itself is using .htaccess file to redirect /pg, /action etc. So, I think there is no other way than using .htaccess.
Elgg's page handling is pretty bad but you can register handlers as follows.
for /mypage:
elgg_register_page_handler('mypage', function($pages){
//content here
//the $pages parameter is an array. so /mypage/a/b with return
// array('a','b');
});
Matt Beckett has written a profile URL plugin (https://community.elgg.org/plugins/1091233) that, though for 1.8 and above, is only 35 lines of code and does exactly what you ask. You should be able to adapt this quite easily for 1.7.8.
He has also written a fuller page handler hijack plugin that may help if you have other use cases apart from user profiles - see https://community.elgg.org/plugins/854839
It is also only for 1.8 and above, however, and may take more effort to backport than the first.

Ellipsis in Firefox without going to Mozilla.org

In order to get ellipsis to work in Firefox, I need to create an extra XML file that makes several references to Mozilla.org to get the Firefox to recognize the CSS3 text-overflow feature.
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
However, if possible, I will like to not having to refer Mozilla.org at all if I can get all the definitions locally on the web servers just in case if the web servers blacklist Mozzila.org.
And curiously "http://www.mozilla.org/xbl" returns a 404 error but the xmlns is definitely required, otherwise ellipsis will not work.
Please let me know if anyone has a better solution.
Thanks,
badallen
The url is really just an identifier that is unique. The fact it looks like a url is just because that is an easy way to create an unique identifier.

Resources