Why isn't this web site substitution rule not working? - lotus-domino

I have an agent that sends out a url to a file. In order to hide the specifics of where that file exists, so I thought I'd create a Web Site substitution rule. So instead of the full url to this file, I decided to send out the following url in an email:
https://< website >/Terms/n=< file name >
I created a Web Site Rule that would map this url to the full url containing the location of the file. The rule is as follows:
RULE: Substitution
INCOMING URL: /Terms/n=*
REPLACEMENT: /db.nsf/< view unid >/< document unid >/$FILE/*
I'm getting a 404, File not found or unable to read file. The full url is good -- I know that because I displayed in the agent log and checked it. Any ideas why this is not working?
thanks
Clem

Thanks Per for trying it out and determining that it SHOULD work. I looked at everything in detail and found that in my Rule had a typo. I actually had double-quotes instead of an asterisk! So I had /Terms/n=" instead of /Terms/n=*. Can't believe I missed that.
Thanks!
clem

Related

Redirect URL embedded signing issue

I am using embedded signing...
After signing, the Signer is redirected to Return URL.I am having an issue with Redirect URL - it's been cutoff to the base and ignores the path...
The redirect URL I am submitting is
https:/www.mysite.com/docusign_return/?customparam=123
When document signed, I am always getting response with no "docusign_return" like https:/www.mysite.com/?customparam=123&event=sign_completed.
I am using a developer account...
Thank you for your help
Try to change from:
https://www.nysite.com/docusign_return/?customparam=123
To:
https://www.nysite.com/docusign_return?customparam=123
I suspect the /? confuses the logic to append parameters which DocuSign has to do.
(also note you have a missing slash after https:)

Redirect url for REST service

I am able to reach my website at a certain ip address and I am going to implement a REST service. I have some PHP files that perform actions on a database and I am calling them from the client. I am using linux ubuntu as server and so far I can do this:
http://xxx.xxx.xxx.xxx/api/create/?id=someId&val=someValue
http://xxx.xxx.xxx.xxx/api/delete/?id=someId
I can do the above because inside /var/www/html I have a folder called api that contains another folder called create. The create cointains the file index.php so that I can omit it and execute the URL you can see above.
This works fine but I don't think this is the proper way to do it. I am new with this so I don't know what to do. After some researches I have found that my goal probably be achieved using an .htaccess file use url rewriting but I am not sure.
How can I do this? Do I have to place all the php files in a single folder and then use an htaccess file? (^)
(^) To be more precise: instead of having this
http://xxx.xxx.xxx.xxx/api/create/index.php?id=someId&val=someValue
http://xxx.xxx.xxx.xxx/api/delete/index.php?id=someId
//and so on with other actions...
Do I have to create a folder like
http://xxx.xxx.xxx.xxx/files/
containing all my php files (create.php, delete.php, view.php...) and the use an htaccess to redirect?
I see that websites offer their api using www.domain.com/api/something/?data=Value or www.domain.com/api/something/dataAbout/. Are they doing what I have said about the .htaccess? I hope I have well explained my problem.
htaccess:
RewriteEngine On
RewriteRule ^api/([\w-]+)/?$ files/$1.php [L,NC]
This is inside /var/www/html and I have api inside /home/username/api .
Thanks Emma
Do it like this:
Create php files in a folder files/ subdirectory as create.php, delete.php, view.php etc (by renaming each individual index.php file, you mentioned).
Move away api directory somewhere outside site root.
Once that is done use following .htaccess file in /var/www/html/:
RewriteEngine On
RewriteRule ^api/([\w-]+)/?$ files/$1.php [L,NC]
Then use new URLs as:
http://xxx.xxx.xxx.xxx/api/create?id=someId&val=someValue
http://xxx.xxx.xxx.xxx/api/delete?id=someId
In first, this is not the right way to create a RESTFUL API. My suggestion is to you read a best practices article.
You shouldn't create a CREATE and DELETE folder. You should use HTTP actions.
To create a new record you should use POST. In example, POST /user and in the body you pass the user's information.
In another example, you could use the same route by using different HTTP methods: DELETE /user/1 to delete a user and PATCH /user/1 to edit some already existent user's information.
Hope it's help you.

remove http query parameter from url htaccess

I want to shorten my URI to just my site address that is
http://www.abcdef.org/index.php?pg=23
http://www.abcdef.org/histop.php?pg=1
http://www.abcdef.org/other.php?pg=29
to
www.abcdef.org
How can I rewrite this using my `.htaccess file? I read a lot of articles but could not find any solution.
Use Redirect directive
Redirect /foo.html /bar.html
Apache Documentation
But understand when the user types in whatever URL it will map to your index file in your case. But you can't just hide every URL to the domain name...it doesn't work that way.

Magento REST is not Found after http://{magentoHost}/api/

I am trying to access rest API for Guest User through
http://localhost/b_marketing/api/rest/products, but the page redirects to 404 page. I have checked retrive catalog products in ACL attributes RULES, REST - attributes and REST - ROLES, correctly. It also works correctly on my other project by using these all configurations.
There is one thing I need to mention here that my project works only when I use http://localhost/b_marketing/index.php , despite of setting up the htaccess rewrites and setting rewrite from admin panel. My apache rewrites are also set.
When I use http://localhost/b_marketing/api/?wsdl it works and some xml returns.
But I cannot use http://localhost/b_marketing/api/rest/products
The Response Header is always 404.
I also cannot access REST API using http://localhost/b_marketing/index.php/api/rest/products as well.
Make sure you have rewrite rule in .htaccess.
Go to magento root folder, in your case it is b_marketing
Open .htaccess file in any editor
Locate rewrite rule for api
If you don't have .htaccess file in place, you may consider to copy fron original
Magento packagem
If you run nginx:
.htaccess is not supported. Edit the nginx configuration and add the line:
location /api {
rewrite ^/api/rest /api.php?type=rest last;
}
I read that that line sometimes is already there however with the the word break instead of last. Thats wrong, change it to last.
Make sure to use -MultiViews. As the api.php and /api path have the same name (without extension), Apache might resolve api automatically to api.php and cause trouble.

Simple modrewrite, how does a link appear?

When you use modrewrite to rewrite your urls, when does the rewrite occur. Will the user be able to see the url before rewrite, when hovering over the link? When they hover over a link will their browser display the rewritten url or the url before it was modified with modrewrite?
The rewrite is done in the server so the user will never know,
PHP also doesn't know what link its pointing to only the script file
mod_rewrite acts on the server side, meaning that apache rewrites incoming URLs before responding to the request. Any HTML links you add to a page will point to the URL you entered, as mod_rewrite doesn't modify any outgoing data.
The rewrite occurs when Apache has parsed the request - before the PHP interpreter has been started.