url-rewriting

Haproxy remove port number from URL

我的梦境 提交于 2019-12-08 04:05:48
问题 I have a backend trying to route traffic to a specific IP address and a port. The first hit on the url doesn't contain the port number. But the subsequesnt requests from within the website is not redirected properly. Example: http://test.com has server 123.45.67.89:9080 When I try the URL http://test.com/login --> It is redirected correctly and I get the login page. But once I give the login details and press OK. It is redirected to http://test.com:9080/loginSuccess. The page is available

htaccess Rewrite Rule

孤人 提交于 2019-12-08 04:00:07
问题 I use htaccess to rewrite my URL's so here is what I have: RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?page=$1 [L] So if I go to domain.com/services then it works perfect, but what I want to do is make it so if they do type in domain.com/services.php then it will work instead of not being found. Also.. if I go to domain.com/services/ (with a trailing slash) then it acts like it's not found. Why is this? 回答1: You have limited "rewrite loop" (limited to 2 iterations only). Use these rules: # do

Is there a way to rewrite this url? [closed]

痴心易碎 提交于 2019-12-08 03:43:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I need to redirect all urls like these: www.example.com/blog.php?id=29 to urls like these: www.example.com/blog/29/this-is-a-blogpost Where "This is a blogpost" is the title stored in the database. Is there a way to rewrite these urls in this way ? 回答1: Well mod_rewrite canot query your database and pull the

C# mvc3 redirect sitemap.xml to controller action

我怕爱的太早我们不能终老 提交于 2019-12-08 03:41:27
I want to redirect each call on a website made for www.domain.com/sitemap.xml to a controller action. How can I achieve this? I've got this till so far, but the statuscode returned is an 302. I want to return an 200 status with it, but still redirect / rewrite to an controller action. The reason i'm asking is that I want each call for the mentioned url redirected to a controlleraction. The controller does some foo en generates an xml sitemap. Then the output of this controlleraction needs to be returned. protected void Application_BeginRequest() { //Check if an call for the sitemap.xml has

Mod Rewrite and PHP

☆樱花仙子☆ 提交于 2019-12-08 03:32:53
问题 I am trying to redirect pages using mod_rewrite to the pages with some variables (for using them with PHP's $_GET ). To give an example with few lines: When the user enters /c/stg it redirects to item_show.php?id=$1&f=1 (where f is page number). When the user enters /c/stg/2 it redirects to the second page with show.php?id=$1&f=$2 . I think there are no errors or misuses of these in my file but, here's what I want: I want user to enter / string directly to go item_show.php?id=$1&f=1 with $1

How to create unicode slug for unicode title?

烈酒焚心 提交于 2019-12-08 03:26:06
问题 I want to sanitize blog titles with unicode characters in url. I need to replace invalid characters and spaces with "-" for better seo rewriting like this. http://example.com/это-моя-хорошая Can anyone have any idea how to do it? 回答1: You can use this algorithm for an SEO-friendly Unicode URL: Convert the text to Unicode Normalization Form C, i.e. precomposed characters. Use a regular expression with Unicode character classes to replace each non-letter non-digit character with a space. Remove

C# mvc3 redirect sitemap.xml to controller action

孤街浪徒 提交于 2019-12-08 03:09:48
问题 I want to redirect each call on a website made for www.domain.com/sitemap.xml to a controller action. How can I achieve this? I've got this till so far, but the statuscode returned is an 302. I want to return an 200 status with it, but still redirect / rewrite to an controller action. The reason i'm asking is that I want each call for the mentioned url redirected to a controlleraction. The controller does some foo en generates an xml sitemap. Then the output of this controlleraction needs to

Regex to extract a part out of a URL and use it as a reference in url rewrite

孤街浪徒 提交于 2019-12-08 03:08:09
问题 OK, I'm wondering if someone can lend a hand with a regex I'm trying to write. Basically, what I want to do is use IIS urlrewrite module to do a redirect to a specific URL if the user accesses a URL on another site. The only catch is I have to also capture a bit of the query string, and move it into the redirect. I think I actually DO have the regex correct for this, but it's implementing it in my web.config that is causing the problem. so here is the input, the URL that a user may access

SEF url without name with core php and .htaccess

雨燕双飞 提交于 2019-12-08 02:41:27
问题 I want to make SEF url In that i want to remove file name also from the url. my site is in the core php, I manage to remove the extension from the url but didn't have idea that how to remove the whole file name from the url. As i searched on google i got this code for the .htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] I have no idea that how to write header in php so it goes in related file but don't show the file name in

301 Redirect where 2 domains point to same IP?

核能气质少年 提交于 2019-12-08 02:38:00
问题 I have 2 TLDs example.com and example.ie . example.com and example.ie both point at the same IP address and pull the same content now we could get whacked with a ban hammer from Google for duplicate content so we want anyone accessing *.example.ie and *.example.com to be redirected to www.example.com the problem is as they are both pointing at the same server the .htaccess is the same thus I don't believe we can do the usual: Options +FollowSymlinks RewriteEngine on rewritecond %{http_host}