Yii2 url is to long so I receive a 403 code - yii

Is there any setting for url limit in Yii 2?
Some of my urls are over 300 characters and I get a 403 Forbidden code;
http://website/servicii-de-proiectare-asistenta-tehnica-din-partea-proiectantului-pe-perioada-derularii-lucrarilor-si-executie-de-lucrari-pentru-proiectul-%E2%80%9Emodernizare-drumuri-comunale-dc----dc----si-dc---a-de-pe-raza-comunei-lunca-judetul-boto-ani%E2%80%9D-863506-switch.html
If I shorten the url, it works.
this is my urlmanager rule:
'<title:(.*)>-<id:([0-9]+)>-access-not-granted.html' => 'member/licitatii/access-not-granted',

I tried to find some information regarding this issue and surprisingly enough, I didn't found a thing regarding URL length permitted.
However, I found a Yii way to solve your issue: Short URL Yii extension presented here - http://www.yiiframework.com/extension/google-url-shortener/
Also, please read this documentation that better explains how Yii treats URL routs: http://www.larryullman.com/2013/02/18/understanding-routes-in-the-yii-framework/
I know this does not solve your problem directly, but hope it gets you somewhere!
L.E: Here you have the bitly extension for Short URL's: http://www.yiiframework.com/extension/bitly-url-shortener/
Keep on coding,
Ares.

Why would that rule apply to your URL? From what I can see your URL will never trigger that rule.
I do not think there is a limit with the string of the URL in Yii2, try deleting some of the first part of the string to test this. try with an url like
http://website/proiectul-%E2%80%9Emodernizare-drumuri-comunale-dc----dc----si-dc---a-de-pe-raza-comunei-lunca-judetul-boto-ani%E2%80%9D-863506-switch.html
You might have problems because you have diacritics in the URL, try without them.

Related

URLEncode in htaccess

I'm trying to make an error document show what page you were trying to go to, but am having issues as it does not escape characters by default (as ecpected)
Most solutions I've seen are to use RewriteRule, but I really do not want to do that, as I want the same document to handle many errors. My current solution is:
ErrorDocument 404 http://%{HTTP_HOST}/Error/Error?c=404&p=%{REQUEST_URI}
But that would break apart incases such as "example.com/NotExist&=&^72*(238"
Is there any way to do this?

302 Redirect - Intercepting Redirect response and query string

I am looking to read the Redirect details in the middle ware (is there any other place?). Towards this I have created the required middleware, and the break point is hitting the code. However, unable to locate the Redirect details like path and the query string from the httpContext object. I'm been looking into this for the past hour or so, with no luck. Thanks in advance for your time.
It's in HttpContext.Response.Headers["location"]

Rewrite URL using DSAPI

I need to rewrite URL. i.e. when user send request for 'url1' we will do request to 'url2' ('url1' will not be changed in browser, users should not know anything about that). I've looked a bit around and did not find another solution but DSAPI filter. DSAPI can do what I need, however due to low experience I can't complete that task.
Can somebody suggest me what events should I look into? and what exactly should I do..
I was looking on those events: kFilterStartRequest, kFilterRawRequest or kFilterRewriteURL no success yet.
I've just complete my solution based of DSAPI, please read here how to rewrite URL using DSAPI.

Passing the arguments to a website

Well the title is tricky. I was not sure if this has been already there and how to put it.
Example:
Lets suppose my site is accessible:
http://mysite.com
if mysite does additions: with 2 inputs
Now If the end user need to pass an argument to site like this (so i load the page like this):
http://mysite.com/argument1/argument2
so it should be able to thus go to the result directly: arg1+arg2
This brings to the question:when user types this, how can i retreive argument1 and argument2 and load my site according to that? Is it possible? If yes, Any client site programming solutions?
Thanks in advance.
Found the solution after searching a lot. The correct term for this process is URL-routing. We can overcome this by using #.
www.mysite.com/#/argu1/argu2
Then in the document.ready() we can read the url in the following manner:
var url = window.location;
More sophisticated way is to use the "backbone.js" for the routing. The documentation on the link explains everything
Backbone.js routing

Language name in prestashop URL

my prestashop base site URL is - www.7color.eu. Some urls are showing in this way -
http://7color.eu/lang-en/12-t-shirt.html
http://7color.eu/lang-en/5-gift-item
http://7color.eu/lang-en/content/4-about-us and so on
But it was not like this. "lang-en" part was not in it. i don't understand when and how did it happen. Now i cannot remove this part. i tried to edit htaccess or re-generate it from admin. but no luck. i want the urls like -
http://7color.eu/12-t-shirt.html
http://7color.eu/5-gift-item
http://7color.eu/content/4-about-us etc.How can I do this? i need urgent help please.
I think perhaps it has to do with enabling the nice URL strings.