mod-rewrite

I want to redirect all http requests to https, and all www requests to non-www

谁说我不能喝 提交于 2020-01-06 01:57:31
问题 Here is my current .htaccess file: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php </IfModule> I want to redirect all http requests to https, and all www requests to non-www, and all file requests to index.php For example: http://www.example.com to https://example.com https://www.example.com to https://example.com

I want to redirect all http requests to https, and all www requests to non-www

帅比萌擦擦* 提交于 2020-01-06 01:57:13
问题 Here is my current .htaccess file: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php </IfModule> I want to redirect all http requests to https, and all www requests to non-www, and all file requests to index.php For example: http://www.example.com to https://example.com https://www.example.com to https://example.com

.htaccess rewrite rule for two GET variables on index.php?

我与影子孤独终老i 提交于 2020-01-06 01:08:11
问题 I'm trying to do a rewrite but I couldn't find it or do it myself. I'm trying to convert http://www.homepage.com/variable1/variable2 to http://www.homepage.com/index.php?var1=variable1&var2=variable2 or http://www.homepage.com/?var1=variable1&var2=variable2 I have tried RewriteRule ^/(.*)/(.*)$ ?var1=$1&var2=$2 [NC,L] RewriteRule ^(.*)/(.*)$ ?var1=$1&var2=$2 [NC,L] RewriteRule ^/(.*)/(.*)$ index.php?var1=$1&var2=$2 [NC,L] RewriteRule ^(.*)/(.*)$ index.php?var1=$1&var2=$2 [NC,L] none of these

.htaccess Rewrite url with images from a folder to a php file

荒凉一梦 提交于 2020-01-05 21:27:21
问题 I want to rewrite all the images in my wp-content/uploads folder to a thumbs.php file in wp-content/thumb folder without changing url This is what I have added in my .htacccess # BEGIN img <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{HTTP_USER_AGENT} !someweirdcrawler RewriteRule ^(wp-content/uploads/.+?)\.(jpe?g|png|gif|svg)$ /wp-content/thumbs/index.php?img_source=http://mywebsite.com/$1.$2 [L] <

.htaccess Rewrite url with images from a folder to a php file

断了今生、忘了曾经 提交于 2020-01-05 21:27:09
问题 I want to rewrite all the images in my wp-content/uploads folder to a thumbs.php file in wp-content/thumb folder without changing url This is what I have added in my .htacccess # BEGIN img <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{HTTP_USER_AGENT} !someweirdcrawler RewriteRule ^(wp-content/uploads/.+?)\.(jpe?g|png|gif|svg)$ /wp-content/thumbs/index.php?img_source=http://mywebsite.com/$1.$2 [L] <

Time lock for mod_rewrite in .htaccess file

喜夏-厌秋 提交于 2020-01-05 21:20:33
问题 I have question: RewriteCond %{HTTP_USER_AGENT} (safari|navigator) [NC] RewriteCond IF SOMEONE ASK, IN LESS THAN 30 SECONDS (HALF MINUTE) FOR FILES IN FOLDERS (folder1|folder2|folder3) RewriteRule ^((?!folder3/).*)$ /folder3/$1 [L,NC] Perhaps more simplified: RewriteCond IF SOMEONE ASK, IN LESS THAN 30 SECONDS (HALF MINUTE) FOR FILES IN FOLDERS (folder1|folder2|folder3) RewriteRule ^((?!folder3/).*)$ /folder3/$1 [L,NC] If someone ask (some browser) apache http server for files in folder1 and

CakePHP shows 500 Internal Server Error

强颜欢笑 提交于 2020-01-05 17:36:09
问题 I'm having a problem with my CakePHP installation. I was developing it in a subfolder and it was working fine. But, when I move it into the root folder, it's showing 500 Internal Server Error. For example, it was working fine on: mysite.com/demo/ But, when I move it into the same server root, i.e. mysite.com/ it's showing the error. CakePHP Version: 2.2 As it was working fine on /demo/ folder, I think the mod_rewrite etc. are working fine, so that confused what's happening with the root

htaccess URL redirect to beta subfolder, while using friendly URL rewrite

荒凉一梦 提交于 2020-01-05 15:17:26
问题 Hi I have the following redirection for a friendly URL site <IfModule mod_rewrite.c> Options +FollowSymLinks -Multiviews RewriteEngine on RewriteBase / RewriteRule ^$ /beta/ [L] // Got this from a fellow user in SO but didn't worked RewriteRule ^home index.php RewriteRule ^noticia/([\w-]+)/?$ noticia.php?title=$1 [L,QSA,NC] RewriteRule ^busqueda/([\w-]+)/?$ busqueda.php?item=$1 [L,QSA,NC] RewriteRule ^producto/([\w-]+)/?$ producto.php?item=$1 [L,QSA,NC] RewriteRule ^noticias/page/([\w-]+)/?$

How to redirect /directory/index.html and /directory/index.php to /directory/

陌路散爱 提交于 2020-01-05 12:49:34
问题 I have to do some redirects - index.html and index.php to /. I could redirect www.domain.com/index.html and www.domain.com/index.php to www.domain.com with this line: RewriteRule ^index\.(php|html?)$ http://www.mydomain.com/ [R=301,L] However I still have problems with pages like these: www.domain.com/directory/index.html - returns 200 OK www.domain.com/directory/index.php - returns 300 multiple choices (don't know why) Is it possible to redirect them to www.domain.com/directory/ and do it

How to redirect /directory/index.html and /directory/index.php to /directory/

五迷三道 提交于 2020-01-05 12:49:07
问题 I have to do some redirects - index.html and index.php to /. I could redirect www.domain.com/index.html and www.domain.com/index.php to www.domain.com with this line: RewriteRule ^index\.(php|html?)$ http://www.mydomain.com/ [R=301,L] However I still have problems with pages like these: www.domain.com/directory/index.html - returns 200 OK www.domain.com/directory/index.php - returns 300 multiple choices (don't know why) Is it possible to redirect them to www.domain.com/directory/ and do it