rewrite

WP - URL rewrite - custom post type/parent conflict

情到浓时终转凉″ 提交于 2019-12-13 06:49:57
问题 I've been having trouble with this for a day now and can't seem to find a solution (it's probably blatantly obvious I just can't find/see it). I have a custom post type called product where: 'rewrite' => array( 'slug' => 'product' ) So the posts that I create for that post type have the URLs: example.com/product/first-product example.com/product/second-product example.com/product/third-product etc.. I've also got a page created called Product Info that has the URL: example.com/product I'd

Password protection for a single .htaccess rewrite

二次信任 提交于 2019-12-13 06:25:51
问题 I need a password protection for a single site. This is a seo friendly url: The default path is: http://www.website-url.com/index.php?id_cms=xx&controller=cms and here is the seo url: http://www.website-url.com/content/xx-login I have already the .htaccess and .htpasswd, but how to specify rewriting in .htaccess only for this url? I tried this: <filesMatch "http://www.website-url.com/content/xx-login"> IndexIgnore .htaccess .htpasswd AuthUserFile /absolut_path/.htpasswd AuthName "Login"

Magento custom module with custom url with add .html extension

做~自己de王妃 提交于 2019-12-13 06:14:13
问题 I have created an module and its front end name is test . Now i want a URL like www.exmpale.com/test/red.html (original structure is like 'test/index/index/valuid/1/'). www.exmpale.com/test/green.html (original URL is like 'test/index/index/valueid/3/'). Wheremy crontroller is indexCrontroller and action is indexAction and where red /green ,will coming dynamic from a table. The Table is structure is like tab_id value 1 red 2 blue 3 green Please help me. 回答1: You need to implement the Router

Rewrite rule fir NGINX

老子叫甜甜 提交于 2019-12-13 06:13:09
问题 I'm pretty bad in reg expression and nginx rewrite rules. I need help to figure rewrite rules for the following situation for NGINX. http://example.com/blog/category1/postname => http://example.com/category1/postname http://example.com/blog/category1/helloworld => http://example.com/category1/helloworld Thank you in advance! 回答1: this one is pretty simple, you just want to tell nginx to ignore the word blog ( and I'll assume it has to be followed with the word category1 ) rewrite ^/category1/

Can PHP access the .htaccess rewrite name of a file

和自甴很熟 提交于 2019-12-13 06:08:11
问题 My .htaccess works (not an expert, but do a lot of copy & paste). A typical rewrite for one of my pages looks like this: RewriteRule ^my-grills-parts-and-service/?$ parts-service.php [NC,L] ...where the url "http://www.mydomain.com/my-grills-parts-and-service/" will invoke the parts-service.php file. However, I am using php to construct a fully qualified URL, from what is in the address bar. The problem is, the server variable $_SERVER['SCRIPT_NAME'] will return "parts-service.php", rather

remove directory after main url using htaccess

会有一股神秘感。 提交于 2019-12-13 06:07:55
问题 With the following url http://www.example.com/de/here/ I want to remove the "de" directory (or whatever may be in front of the "here" directory, if anything even is in front of it) so a user is directed to http://www.example.com/here/ instead, which is a directory that does actually exist. The url could even be something like http://www.example.com/it/here/ or any other combination of 2 letters. The url could also just be http://www.example.com/here/ in which case I don't want anything

Nginx+PHP: redirect protected file request to PHP script and then download the file

大兔子大兔子 提交于 2019-12-13 05:58:49
问题 I have an /upload/ directory where users can upload confidential files. Ex: example.com/upload/username/myfile.jpg I want the files to be accessible only by the person who uploaded them in her own directory. In my Nginx server config, I first redirect all location containing "upload" to a PHP file: location ^~ /upload/ { rewrite ^(.*)$ /dl-file.php?$1 break; } So http://example.com/upload/username/myfile.jpg now serves dl-file.php. // Get the url $url = 'https://' . $_SERVER['SERVER_NAME'] .

howto rewrite engine rule

假如想象 提交于 2019-12-13 05:43:42
问题 i'm trying to understand some rules or rewrite engine but i can't figure how to do it. i have this link: w**.example.com/index.php?city=new+york and i wish to rewrite to this new: w**.example.com/good-parties-in-new-york the value of city can change to any other city. but the point here is I only what to rewrite if all the key is: index.php?city= because the index.php?zone= is used for other things, etc... any suggestion? thanks. 回答1: I'm a little confused on what exactly you want to achieve.

URL Rewrite with Query String

让人想犯罪 __ 提交于 2019-12-13 05:35:56
问题 I am writing a rewrite rule in IIS with type Redirect. I want the new url to have a query string parameter value added newly to it. The old url does not have any query string values. What is the best way to achieve this? Old url: abc.com/2017/Sample-Page New Url: test.abc.com/2017/Sample-Page?redirect=y <rule name="rewrite with query string" stopProcessing="true"> <match url="(.*)2017/Sample-Page(.*)" /> <conditions> <add input="{HTTP_HOST}" pattern="abc.com" /> </conditions> <action type=

how to set asp.net web.config rewrite http to https and www to non-www

♀尐吖头ヾ 提交于 2019-12-13 05:27:21
问题 I m very noob on the rewrite part, hope someone can help me. Now i m using this <rewrite> <rules> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTPS}" negate="true" pattern="^on$" ignoreCase="false" /> </conditions> <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="Found" /> </rule> </rules> </rewrite> This only can change http to https only, now I hope it can support to