url-rewriting

French characters with rewrite rule

拜拜、爱过 提交于 2019-12-11 12:09:01
问题 I have categories name in my database, and some of theme have french characters like é è ê. It works as desired until today when I tried to add another character à to it then I started getting SERVER ERROR Here is my .htaccess: Options +FollowSymlinks RewriteEngine on RewriteRule ^([A-Za-z0-9éèêà_-\s]+)-(\d+)\.htm$ classified.php?id=$2 [L] As you can see, it works fine without the à. How do I add that thing into the regex ? 回答1: If you are using all sort of characters and accented letters,

.htaccess rewrite url and removing .php

馋奶兔 提交于 2019-12-11 11:45:56
问题 I want to remove the .php from the url through htaccess file. for example home.php to home I'm using the following rewrite rule in htaccess file. RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L] and also I want to rewrite the url. for example /detail.php?ca=38&title=rewrite uri sample to detail/article/38/rewrite uri sample 回答1: I try search to the entire www, then I have an answer.. RewriteEngine On Options +FollowSymLinks -MultiViews RewriteRule ^article/([0-9]+)/?$ detail.php?ca=$1 [NC,L]

URL Rewrite to change querystring case

匆匆过客 提交于 2019-12-11 11:39:40
问题 I am looking to setup a URL rewrite rule in my web.config that will modify the following URL: /detail.aspx?aID=164&mode=t To (see case of aid ): /detail.aspx?aid=164&mode=t Please can anyone assist me with this? The only other thing to mention here is that the rule should still work if there is no mode parameter at the end and irrespective of what order the aid parameter appears in the querystring. EDIT 1 I found this guide which rewrites the whole URL to lowercase. This would work for me

Wordpress URL rewrite custom taxonomy using add_rewrite_rule() or generate_rewrite_rules()

岁酱吖の 提交于 2019-12-11 11:39:36
问题 I'm trying to get my head around amending some URL's for a website I have created. After reading two (very informative) answers (1, 2) but I'm still a little unsure how to approach creating a URL that shows a custom post type in the hierachy of it's categories (created by custom taxonomies). From my reading, I gather that add_rewrite_rule or generate_rewrite_rules seem to be the best options to use, but I cannot seem to get it functional... like... at all! Here is the URL structure I have

.htaccess: Problem with URL rewriting

有些话、适合烂在心里 提交于 2019-12-11 11:38:27
问题 I'm new to url rewriting and having a problem i can't figure out. I got this 2 conditions: RewriteRule ([^/]+).php index.php?com=cat&catname=$1 [L] RewriteRule ([^/]+)/([^/]+).php index.php?com=detail&catname=$1prodname=$2 [L] and need 2 urls like this: website.com/category-name.php website.com/category-name/product-name.php It seems that the first condition rules upon the second... i mean: if i call the first url everything works fine, but when i call the second url i can't get variables as

nginx rewrite rule to remove - and _

一曲冷凌霜 提交于 2019-12-11 11:34:18
问题 i need a nginx rewrite rule for the following problem: I have Urls that include several hyphen and eventually underscores Example request: http://www.example.com/cat/cat2/200-AB---a-12_12-123.312/cat-_-cat/cat/dog---I would give a 404 error so in need a 301- redirect to: http://www.example.com/cat/cat2/200-AB-a-12-12-123.312/cat-cat/cat/dog-I So all underscores should be replaced with hyphens and there should be only one hyphen a time. short version: replace --- with - and replace _ with -

URL Rewrite rule based on certain conditions

混江龙づ霸主 提交于 2019-12-11 11:32:37
问题 I am in process to apply URL rewriting rule based on certain condition in my .htaccess file but have got struck due to my near to zero level knowledge of URL rewriting using Apache .htacces.Here is my use case i have few plugins in my WordPress application and those plugins making use to certain CSS and JavaScript,all i want that those URLs should be served from the CDN server, due to some issues i can not use a simple rewrite which will rewrite the URL for entire application as that thing is

htaccess rewrite rule ends in an infinite loop

人盡茶涼 提交于 2019-12-11 11:27:56
问题 I would like to permanently redirect www.example.com/event/title-goes-here to www.example.com/event/jazz/title-goes-here with a regex in my htaccess file. I currently have: RewriteEngine on RewriteRule ^event/(.*)$ http://www.example.com/event/jazz/$1 [R=301,L] But this results in an infinite loop (it goes to example.com/event/jazz/jazz/jazz/jazz etc) because the /event/ part is the same. How can I use the rewrite rule to make this rewrite, and also in a way that it takes into account that

Removing Part of URL with .htaccess

亡梦爱人 提交于 2019-12-11 11:23:53
问题 I have recently removed a module from Magento that created vanity URL, for filtered searches. When I've removed this module its now using URL parameters for all filtered navigation pages. I want to redirect all of these vanity urls to the same page without the vanity part of the URL. An example of a URL that I want redirecting is: /hand-dryers/high-speed/shopby/brand-jet_towel-ultradry-magnum_multi_dri-dyson/handdryer_dryingtime_seconds-under_10_seconds/ Redirecting to /hand-dryers/high-speed

htaccess mod-rewrite: link to subdirectory from root - neglect dirs in subdirectory?

风流意气都作罢 提交于 2019-12-11 11:15:16
问题 I asked part of this question a while ago on stackoverflow and this works perfect: es I have a multi-domain-server each directory is correspondend to a domain-name. However my main-domain name www.mydomain.com is also a directory on my server and not linked to automatically. This is why I use this in my root of the website … root/.htaccess RewriteEngine On RewriteCond %{REQUEST_URI} !^/my-website/ RewriteCond %{DOCUMENT_ROOT}/my-website%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}/my