mod-rewrite

Rerouting all http traffic to https with AWS ELB

≡放荡痞女 提交于 2019-12-17 18:56:09
问题 So I've looked over the other similar questions and they offer solutions but none of them seem to work for some reason. So, for starters, my ELB is set up so that HTTP (incoming) -> HTTP (instance) HTTPS (incoming) -> HTTP (instance) So both traffic should come in on port 80. And this works, as when I access my site using http://mydomain.com or https://mydomain.com, it is able to display even though I only have a VirtualHost for on port 80. The issue is with attempting to rewrite all http

Mode Rewrite; with/without trailing slash on end of url?

谁都会走 提交于 2019-12-17 18:24:33
问题 I basically tried this mode_rewrite rule below. It works with a slash on the end but I want it to work whether it has a trailing slash on the end or not. Basically I want it like this as some people see it as normal with a slash on the end and others don't hence why I want it to work whether it's there or not. RewriteRule ^signup/register(.[^/]*) /signup/register.php [NC] Basically it will work like http://localhost/signup/register/ but if I remove the / from the end it gives 404 error. 回答1:

Remove www site-wide, force https on certain directories and http on the rest?

拜拜、爱过 提交于 2019-12-17 17:46:08
问题 Firstly, I would like to remove the www. from my domain name http://www.example.com => http://example.com I would also like for certain directories to be secure (https), while the rest remain http http://example.com/login => https://example.com/login Obviously it needs to work for all conditions, for example if someone types in: http://www.example.com/login => https://example.com/login Also when people navigate away from the login page it returns to http. Currently in the .htaccess is the

RewriteRule causes page to reload twice

六月ゝ 毕业季﹏ 提交于 2019-12-17 16:57:14
问题 I shaped two different RewriteRules for my page: # Enable URL Rewriting RewriteEngine on # exclude followed stuff RewriteRule ^(js|img|css|favicon\.ico|image\.php|anprobe|content|libs|flash\.php|securimage)/ - [L,QSA,S=2] # conditions (REQUEST dont point @ file|dir|link) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-F RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l # rules RewriteRule ^(?!index\.php)brillen/(.*(brillen)|360|neu)/(.*)([a-zA-Z0-9]

mod_rewrite - how to rewrite an URL?

孤街醉人 提交于 2019-12-17 16:56:11
问题 Is there a way to rewrite an URL like http://mydomain.com/getProduct.php?id=1&mode=simple in http://mydomain.com/products/1/simple using mod_rewrite in Apache2? 回答1: RewriteRule /products/([0-9]+)/([a-z]+) /getProduct.php?id=$1&mode=$2 For more information search google for mod_rewrite tutorials. 回答2: You may find this article helpful: URL Rewriting for beginners. Also search for Mod Rewrite Cheat Sheet in Scribed, I found it helpful before. [ Sorry couldn't post the link as I am allowed to

mod_rewrite - how to rewrite an URL?

自闭症网瘾萝莉.ら 提交于 2019-12-17 16:56:09
问题 Is there a way to rewrite an URL like http://mydomain.com/getProduct.php?id=1&mode=simple in http://mydomain.com/products/1/simple using mod_rewrite in Apache2? 回答1: RewriteRule /products/([0-9]+)/([a-z]+) /getProduct.php?id=$1&mode=$2 For more information search google for mod_rewrite tutorials. 回答2: You may find this article helpful: URL Rewriting for beginners. Also search for Mod Rewrite Cheat Sheet in Scribed, I found it helpful before. [ Sorry couldn't post the link as I am allowed to

remove query string from end of URL using .htaccess

痴心易碎 提交于 2019-12-17 16:37:51
问题 I'm trying to remove string from the end of URL: For example i have a structure like this: http://sitename.com/category/first-category-name/?post_type=question http://sitename.com/category/second-category-name/?post_type=question http://sitename.com/category/...-category-name/?post_type=question I would like to remove ?post_type=question from the end of URL. I found a lot of examples on stackoverflow, but no one works for me. Thank you. 回答1: it's simple, just use: RewriteCond %{QUERY_STRING}

Apache mod_rewrite REDIRECT_STATUS condition causing directory listing

£可爱£侵袭症+ 提交于 2019-12-17 16:28:13
问题 I have the following htaccess rewrite rules. The one rule condition to prevent looping was originally written this way: RewriteCond %{ENV:REDIRECT_STATUS} ^. It used to work just fine, until it suddenly stopped working causing Apache to display the directory listing of the website. I had to change it to this new form, as in the listing below, to have it work again: RewriteCond %{ENV:REDIRECT_STATUS} 200 Do you have any idea of the reason of this behaviour? Thank you RewriteEngine on

xampp apache rewrite not working

让人想犯罪 __ 提交于 2019-12-17 14:56:51
问题 I have a folder called crm in htdocs which contains a fresh laravel 5.1 project and i am trying to acess it via http://localhost/crm/ but it just brings the index of page containing the directory contents instead of the page mapped in my routes.php as Route::get('/', function () { return view('panel'); }); i have checked that apache mod_rewrite is enable in httpd.conf LoadModule rewrite_module modules/mod_rewrite.so DocumentRoot "C:/xampp/htdocs" <Directory "C:/xampp/htdocs"> Options Indexes

mod_rewrite - change URL case

我是研究僧i 提交于 2019-12-17 14:54:02
问题 Is there any straightforward way to change the case of any URL using mod_rewrite? I thought this was pretty trivial... apparently not. Examples: http://example.com/id to http://example.com/ID http://example.com/id/123 to http://example.com/ID/123 and so forth. 回答1: mod_rewrite has some internal functions you can use for a mapping. One of them is toupper that converts letters to uppercase: RewriteMap uppercase int:toupper RewriteRule [a-z] %{uppercase:%{REQUEST_URI}} [L,R=301] 回答2: I was