I'm looking for a trick to hide the .dll extension of an isapi dll in an url. I don't know if this is possible. but I preffer to hide it.
Example
www.mysite.com/test/myapp.dll/testfunction
would be
www.mysite.com/test/myapp/testfunction
Thank you very much
You may change the link on page to say ww.mysite.com/test/myapp/testfunction and use the following config with ISAPI_Rewrite 3:
RewriteBase/
RewriteRule ^test/myapp/testfunction$ /test/myapp.dll/testfunction [NC,L]
You can write ISAPI filter and change the URI as you like. There are, of course, ready commercial and free ones
This link may be of use
EDIT: The link above is actually confusing as I don't think it solves the problem at hand.
These two links
this One requires some coding,
this One requires some IIS Setup
In IIRF, a free URL rewriter for IIS5/6/7, you can do this:
RewriteRule ^/test/([^/]+)/([^/]+)$ /test/$1.dll/$2 [I,L]
This rule has wild-card matching on the DLL name and function.
Lots more possibilities, too.
Related
I'm trying to create friendly url for my site but with no success :(( and i have two questions
The first is:
How to change the url from domain.com/page/something.php to domain.com/something
And the second is:
Will the changes make duplicate content and if how to fix the problem.
Thank you for your time,
Have a nice day
Check out the official URL Rewriting guide: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
You'll be using the simplest use case, Canonical URLs. Assuming you have no other pages that you need to worry about, you can use a rule like this: (note: untested, your usage may vary)
RewriteRule ^/(.*)([^/]+)$ /$1$2.php
While that example might not exactly work for your use case, hopefully reading the guide and my example will help you get you on your way.
In Mediawiki, I'm trying to find a way to block access to some of our template pages. I don't want some of our competition viewing our complex code and stealing it for their wikis (which is common in the fandom I'm from unfortunately). So I was trying to use htaccess to accomplish this by redirecting people to the main wiki page when they try to view a specific template page. However, nothing is happening. Here's what I used:
Redirect /wiki/index.php?title=Template:Box /wiki/index.php
I'm not sure what I'm trying to do is possible, though, or if this is how htaccess is supposed to be used!
Thank you in advance!
In short words: don't do that!
Let me quote the relevant part of MediaWiki docs: MediaWiki is not designed to be a CMS, or to protect sensitive data. To the contrary, it was designed to be as open as possible. Thus it does not inherently support full featured, air-tight protection of private content.
There's no way MediaWiki guarantees partial read permissions: either people are able to see every page, or none of them. Otherwise, there will be loopholes to read your precious data. For example, TerryE's trick with rewrite rules adds absolutely no security: among a hundred of other ways, one can simply change Template:Box into Template_:_Box and the latter will be normalised internally into the former. MW sometimes HTTP-redirects to normalised titles, but that is very easy to overcome.
There are lots of ways of getting template content in MW, and MW has its own access control extensions, so I think that you are trying to cure a leaking sieve, but answering your Q directly:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} \bTemplate:Box\b
RewriteRule wiki/index.php $0? [L]
This will remove the query parameters if the URI is for /wiki/index.php and the query string contains Template:Box.
I am complete newbie in mod_rewrite, and I have been going through some sites reading how to handle this, all I could find was when the get variable was numbers and nothing about strings, and it turns out be over my head.
What I want to do is to rewrite display.php?name=blahblah123 to display/blahblah123
Together with the answer, I would love some sites where I can build some grasp over mod_rewrite myself.
Thanks
Edit:
With more searching, I came up with this
RewriteEngine On
RewriteBase /
RewriteRule ^display/([a-z]+)$ display.php?name=$1 [L]
The code above works, but for some reason, The page I get has no CSS. The CSS I see included shows Hostgator's 404 page CSS. But HTML looks fine, so does the content and everything else. Any idea?
Just to be clear, mod_rewrite is something that happens internally in apache. I find that sometimes people do not understand what it does and doesn't do. It will not take a url that you output and change it from
display.php?name=blahblah123
to
display/blahblah123
It will however, allow someone to make a request from your site for display/blahblah123 and convert that to display.php?name=blahblah123, so that your display.php script can operate on it.
Rewrite rules require an understanding of regular expressions. The better you understand regex the easier mod_rewrite will be for you.
As a beginner this article should help: http://www.sitepoint.com/guide-url-rewriting/
For your specific question, I'd probably use:
RewriteRule ^display/([a-zA-Z0-9]+)$ /display.php?name=$1
Try to put a "/" in front of the css file name.
<link rel=".." href="/style.css".
instead of
<link rel=".." href="style.css".
I have a cms that does not generate friendly url's
What is the best way to rename this without getting double content by google.
Now I have in .htacces:
RewriteEngine On
RewriteBase /
RewriteRule welcome.html page.php?1[L]
RewriteRule about-us.html page.php?2[L]
Is this the best way to do?
Any help would be appreciated
Google has no problem spidering and indexing this very simple dynamic URL scheme. But if you want extra onpage-optimization-bonus-points with the help of keyword-stuffed-URLs it would be best you switch to a CMS that creates them automatically. You save time by avoiding to maintain the link-scheme manually both in your content and the rule-file.
If not there's always the chance you forget to replace those dynamic links with your readable ones if you create new content. Also your cms will always answer both variants: the friendly one and the dynamic one, so you have to tell Google the "canonical" URL (Explanation here) to avoid duplicate content. This might happen because you can't tell how people link to content on your site.
I need mod_rewrite functionality on an IIS .NET server. Is http://www.isapirewrite.com/ the best option? It seems to have the largest documentation/user base. I also see codeplex.com/IIRF , this is free but comments mention it has a different syntax from .htaccess? I am very unfamiliar with IS .NET and would like to mimic Apache .htaccess, please advise.
I will be 301 redirecting, as well as canonicalizing urls.
I also see both ISAPI_Rewrite 2 and 3 both being sold for the same price. Why might I consider 2?
Thank you so much for your time, thoughts and help.
If you use ISAPI_Rewrite 3 it has almost identical syntax to mod_rewrite (see http://www.helicontech.com/isapi_rewrite/doc/compatibility.htm).
I've used it on a number of sites and am very happy with its performance and ease of use.
Josh
IIRF supports most of the same syntax as mod_rewrite's .htaccess, but some things are missing.
It works well .
The price is right.