mod-rewrite

executing commands in AWS ebextensions

会有一股神秘感。 提交于 2021-01-27 07:23:36
问题 I receive the following error while trying to upload my instance in aws elasticbeanstalk: The configuration file .ebextensions/setup.config in application version t5 contains invalid YAML or JSON. YAML exception: while scanning a quoted scalar in "<reader>", line 3, column 18: command: "aws s3 cp s3:elasticbeanstalk-u ... ^ found unexpected end of stream in "<reader>", line 5, column 1: ^ , JSON exception: Unexpected character (c) at position 0.. Update the configuration file. Below is what

Redirect 301 with regular expresions to other url with similar numeration

我的梦境 提交于 2021-01-05 08:58:19
问题 I migrated my articles in website, and the CMS system transform de URLs. I need to redirect URLs similar to: Example, Case 1. Same article name and diferent number at the end of URL: Original URL: https://www.website.com/folder/2087-name-of-the-article Source URL https://www.website.com/folder/name-of-the-article-r929/ Example, Case 2. Same article name and diferent number at the end of URL, but with other subfolder: Original URL: https://www.website.com/folder/2087-name-of-the-article Source

HTACCESS redirect using URL parameter ID number range

旧巷老猫 提交于 2021-01-02 06:34:41
问题 I'm hoping someone can help as this is proving difficult to figure out. I am trying to redirect via HTACCESS and mod_rewrite a number of pages that have a URL parameter ID value within a particular range (from 1 to 7603). Here is what I have so far: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{QUERY_STRING} &?id=\b([1-9][0-9]{0,2}|[1-6][0-9]{3}|7[0-5][0-9]{2}|760[0-3])\b [NC] RewriteRule ^example\.php$ http://www.website.com/? [R=301,L] </IfModule> It currently does redirect the

.htaccess - get current url and pass part of it as variable

天大地大妈咪最大 提交于 2021-01-01 06:36:21
问题 I need to write optimized .htaccess rules. I had written like that and they are working RewriteEngine on RewriteRule ^city1-name-in-url/$ products.php?city=city1-name-in-url RewriteRule ^city2-name-in-url/$ products.php?city=city2-name-in-url RewriteRule ^city3-name-in-url/$ products.php?city=city3-name-in-url RewriteRule ^city4-name-in-url/$ products.php?city=city4-name-in-url And url for these rules are http://www.domain.com/global/city1-name-in-url/ I have to write these rules for 800

Make URL alias in Wordpress (or .htaccess)

怎甘沉沦 提交于 2020-12-30 07:00:14
问题 I have a site running on Wordpress, and I want to create one custom short-url. If a page URL is www.mysite.com/category/post I want the user to be able to visit www.mysite.com/alias If there is a 'Wordpress-y' way of doing things, that would be preferable, but I am also able to do it by modifying the .htaccess file. Thanks 回答1: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^alias$ category/post [R=301,L] </IfModule> 回答2: I realize this is a bit of an old post, and already has an

Redirect non-www and non-http to https

对着背影说爱祢 提交于 2020-12-25 01:08:53
问题 Yesterday I Installed SSL on the server. Since than I can't reach some pages. www.example.com/amsterdam/shoes example.com/amsterdam/ ^ both do not redirect to https://, not even http:// www.example.com/amsterdam ^ does redirect to https:// How do I redirect all pages to HTTPS with www via .htaccess? 回答1: RewriteEngine on RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ https://www.example.com%{REQUEST_URI} [NC,L,R=301,NE] This will redirect both http or non-www to

Redirect non-www and non-http to https

走远了吗. 提交于 2020-12-25 01:07:46
问题 Yesterday I Installed SSL on the server. Since than I can't reach some pages. www.example.com/amsterdam/shoes example.com/amsterdam/ ^ both do not redirect to https://, not even http:// www.example.com/amsterdam ^ does redirect to https:// How do I redirect all pages to HTTPS with www via .htaccess? 回答1: RewriteEngine on RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ https://www.example.com%{REQUEST_URI} [NC,L,R=301,NE] This will redirect both http or non-www to

Redirect non-www and non-http to https

大城市里の小女人 提交于 2020-12-25 01:07:08
问题 Yesterday I Installed SSL on the server. Since than I can't reach some pages. www.example.com/amsterdam/shoes example.com/amsterdam/ ^ both do not redirect to https://, not even http:// www.example.com/amsterdam ^ does redirect to https:// How do I redirect all pages to HTTPS with www via .htaccess? 回答1: RewriteEngine on RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^ https://www.example.com%{REQUEST_URI} [NC,L,R=301,NE] This will redirect both http or non-www to

Rewrite only the middle part of URL - mod rewrite .htaccess

只愿长相守 提交于 2020-12-12 08:33:12
问题 I want to change cadeaushop part in the url to hobby-cadeau-shop . I made the following mod rewrite in my htaccess file: RewriteRule ^cadeaushop/(.*) http://www.zovyo.nl/hobby-cadeau-shop/$1 [QSA,L] It works nice, but on one place I want something else. the shopping cart uses https, a secure url. Now this url is also set to http. How can I change the mod rewrite so the first part of the url doesn't change? I tried some changes, like RewriteRule ^cadeaushop/(.*) /hobby-cadeau-shop/$1 [QSA,L]

Rewrite only the middle part of URL - mod rewrite .htaccess

冷暖自知 提交于 2020-12-12 08:29:58
问题 I want to change cadeaushop part in the url to hobby-cadeau-shop . I made the following mod rewrite in my htaccess file: RewriteRule ^cadeaushop/(.*) http://www.zovyo.nl/hobby-cadeau-shop/$1 [QSA,L] It works nice, but on one place I want something else. the shopping cart uses https, a secure url. Now this url is also set to http. How can I change the mod rewrite so the first part of the url doesn't change? I tried some changes, like RewriteRule ^cadeaushop/(.*) /hobby-cadeau-shop/$1 [QSA,L]