rewrite

Multiple conflicting htaccess RewriteRules

南楼画角 提交于 2020-01-06 04:31:08
问题 I'm trying to have both people's profiles at example.com/Sara and a few special pages like example.com/home and /account. How do I make both of my RewriteRules work? Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ ./people.php?s=$1 RewriteRule ^home ./home.php Thanks! Edit: Figured it out...! Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f

IIS7 and Enforce lowercase URLs

我是研究僧i 提交于 2020-01-06 01:30:34
问题 I tried to use option in iis7 Enforce lowercase URLs, but when i enabled it all images that had *.JPG extension (uppercase) stopped server. in prev version of iis it was ok when using upper and lower cases, it returned same source may i fix it? or should i create rule for each extension like (jpeg, jpg, gif...) 回答1: I was just reading an article on writing rules, from Scott Gu Tips/Trick: Fix Common SEO Problems Using the URL Rewrite Extension He talks about the issue of excluding static

REGEX rewrite issue to allow hyphen

与世无争的帅哥 提交于 2020-01-05 23:42:18
问题 I have a web service that I have a rewrite on. I need to be able to allow hyphens or dash in the query. Here is my rewrite: rewrite ^/app/api/sanction/([0-9]+)/athleteList/([a-zA-Z0-9,]+)/-([0-9,]+)$ /app/athleteList.phtml?s=$1&l=$2&c=$3 last; The query works fine like this: /app/api/sanction/35172/athleteList/MLEVEL07/25001,24450 However when I put a dash or hyphen here, the query will fail. /app/api/sanction/35172/athleteList/MLEVEL-07/25001,24450 As you can see, I have the hyphen listed in

HTAccess rewrite dynamic page url

半城伤御伤魂 提交于 2020-01-05 12:12:49
问题 thanks for your help in advance Basically i have made a dynamic url website http://planet-dj-surrey.com/ I cant seem to figure out the code for the htaccess file to redirect a dynamic page and make it cleaner. for example i want http://planet-dj-surrey.com/index.php?page=designprocess to be changed to http://planet-dj-surrey.com/designprocess/ currently i have this but it does not seem to be working, RewriteEngine On RewriteRule ^/dropdownchoice/$ index.php?page=dropdownchoice [NC] Thanks in

GET, URL-Rewrite

夙愿已清 提交于 2020-01-05 12:12:32
问题 Continued from my previous thread: GET, if, elseif I'm using a CMS but it has URL rewrite somewhere through the files. How would I go around getting the $_GET to work without the .php extension? Options +MultiViews That still won't let me visit /something.php it says not found. (Would it be because the pages aren't in /, they are in another directory using a template system? 回答1: If you are using apache HTTP server, then you should consider to use multiview option. No need to use RewriteRule

Allow multiple IPs to access Wordpress Site Admin via .htaccess

与世无争的帅哥 提交于 2020-01-04 02:55:47
问题 I currently have a wordpress site that is being upgraded and I have a maintenence redirect setup in the .htaccess file. I can allow my own IP access the site and admin but how can I allow multiple IPs access for the other editors to also have access. I'm currently using : RewriteEngine on RewriteCond %{REMOTE_HOST} !^123.456.789.101 #RewriteCond %{REMOTE_ADDR} !^123.456.789.101 RewriteCond %{REQUEST_URI} !/maintanence.html$ [NC] RewriteCond %{REQUEST_URI} !.(jpe?g?|png|gif) [NC] RewriteRule .

.htaccess regular expression issue

妖精的绣舞 提交于 2020-01-03 05:58:13
问题 I still have no answer about this so I'm posting it here. I want to match an url in the form of root/language/sub/.../document in a .htaccess file and then rewrite it as root/sub/.../document.php?lang=language Im close to hit but it seems my regexp doesn't 'catch' the input url. Here it is : RewriteCond %{REQUEST_FILENAME} !-d RewriteCond ^[a-z]{2}.*$/%{REQUEST_FILENAME}\.php -f RewriteRule ^([a-z]{2})/(.*)$ $2.php?lang=$1 Can someone point me out what is wrong here ? I'm no expert in regexp

Automatic URL Rewriting

一个人想着一个人 提交于 2020-01-03 05:07:07
问题 I have created .htaccess file. The original URL is: http://example.com/folder/page.php?page=1&ipp=All&link=view_link Redirected : http://example.com/folder/page/1/All/link.html Redirecting works correctly.But,Now the problem is , it will be redirected only if i give the rewrited URL manually. But it should do automatically only. my requirement is if anybody type "page.php?page=1&ipp=All&link=view-link" then automatic convert /page/1/All/link.html 回答1: I'm still very unclear on what you want

Redirect internal to path, if resource doesn't exists

馋奶兔 提交于 2020-01-03 03:39:12
问题 i am trying to redirect internally to another location, so the user won't see the "script" location / uri, if an image does not exists: RewriteCond %{REQUEST_URI} ^/resources/img/tires [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^resources/img/tires/(.*)$ reifen/imagematch/$1 [L] For example if i request an image: http://domain.tld/resources/img/tires/manufacturer/image.jpg -> Image exists, directly serve the image. And if i request: http://domain.tld/resources/img/tires

What does RewriteRule ^(.*)/$ ?path=$1 [QSA,L] mean in my .htaccess?

浪尽此生 提交于 2020-01-02 08:52:11
问题 I need to create rewrite in nginx as is done in my .htaccess and there are some lines which I don't completely understand. DirectoryIndex index.php RewriteEngine on RewriteCond % !-f RewriteRule ^(.*)/$ ?path=$1 [QSA,L] Can someone explain it to me? 回答1: RewriteCond % !-f seems incorrect rule condition and is always evaluating to true. This rule: RewriteRule ^(.*)/$ ?path=$1 [QSA,L] Is matching any URI with trailing slash and internally rewriting to /?path=uri-without-slash So for ex: an URI