.htaccess

Redirect http://www.domain.com to https://www.domain.com using .htaccess

扶醉桌前 提交于 2020-01-03 05:03:29
问题 I want to redirect my domain from http to https: http://www.domain.com --> https://www.domain.com Is it possible? I've been searching around the internet but I only found: http://domain.com --> https://www.domain.com The question is, how about peoples arriving directly on http://www.domain.com? Aren't they be served with non-https url? Same as the vice versa. I just want a simple redirection from the HTTP to HTTPS. Is it possible? Thank you 回答1: It will work for ALL versions of php and will

Redirect index.php request to http://localhost/website/ using .htaccess

半世苍凉 提交于 2020-01-03 04:59:06
问题 I'm not so familiar with configuring my .htaccess yet so please help me out. I have a link that goes to the index.php but I don't want index.php to appear in my url eg. http://localhost/website/index.php I want it to be redirected to the root folder which is http://localhost/website/ So i tried searching for answers and this is what I got so far. RewriteEngine on Options +FollowSymLinks RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ http://localhost/website/$1 [R=301,L]

.htaccess hotlink protection - add image exception

南笙酒味 提交于 2020-01-03 04:52:08
问题 So this is my code: RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://my-site.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://my-site.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.my-site.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.my-site.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|)$ http://www.my-site.com/dontsteal.png [R,NC] But I have this .htaccess file inside the images diretory. I dislike moving the dontsteal.png file from images because the file tree gets

Wordpress add rewrite rule to point to plugin file

自闭症网瘾萝莉.ら 提交于 2020-01-03 04:36:07
问题 Firstly, I have tried several different suggestions from other stackoverflow users but I haven't had any luck. I'm trying to build a kind of api from inside a plugin. The task is to let an external system call a URL within my plugin in order for it to initiate an internal procedure. Currently I have a class which has a contructor. This is inside that constructor. add_action( 'init', 'my_rewrite' ); function my_rewrite() { global $wp_rewrite; $plugin_url = plugins_url( 'my-api.php', __FILE__ )

Using .htaccess to Rewrite URLs with ID and Filename

落花浮王杯 提交于 2020-01-03 04:34:13
问题 I am trying to rewrite a URL with .htaccess and had a question that I'm unable to find an answer to after many hours of searching. And, it doesn't help that my regex skills aren't that great... The underlying format for my URLs is this: http://mysite.com/article.php?id=1 . I would like to have a URL like this direct there: http://mysite.com/article/1/made-up-irrelevant-title-slug . The problem is, I'd like the article to be a variable such that it could be changed to page and would direct to

redirection issue in www to non www with ssl/https

落爺英雄遲暮 提交于 2020-01-03 04:27:08
问题 I have a SSL certificate for non www URL: https://domain.com I know there are many similar question, but none of them seems to solve my problem. Here is what I am trying to do: Problem: 1) http://www.domain.com -> https://domain.com **www to non www DONE** 2) http://domain.com -> https://domain.com **http to https DONE** 3) https://www.domain.com -> https://domain.com/ **NOT DONE** - Getting ERROR ON Above URL number (3): Your connection is not private So far, my .htaccess file looks like so:

Laravel 5 shared hosting deployment issues

流过昼夜 提交于 2020-01-03 04:24:06
问题 I am trying to deploy laravel 5.2 on shared hosting. I installed the laravel core app folder a level above the public_html folder (/../public_html or /home/username ). I extracted the files in the laravel core public folder (public) and pointed the index.php file to the laravel core app folder a root above (/../laravel-app/bootstrap/autoload.php and /../laravel-app/bootstrap/app.php). The website homepage is working but pages links are returning a 404 and it isnt pulling in any css or js. Any

Laravel 5 shared hosting deployment issues

喜夏-厌秋 提交于 2020-01-03 04:24:05
问题 I am trying to deploy laravel 5.2 on shared hosting. I installed the laravel core app folder a level above the public_html folder (/../public_html or /home/username ). I extracted the files in the laravel core public folder (public) and pointed the index.php file to the laravel core app folder a root above (/../laravel-app/bootstrap/autoload.php and /../laravel-app/bootstrap/app.php). The website homepage is working but pages links are returning a 404 and it isnt pulling in any css or js. Any

mod_rewrite rules for clean URLs with optional parameters

僤鯓⒐⒋嵵緔 提交于 2020-01-03 04:01:07
问题 I have the current URL: http://domain.com When you visit this URL it by default loads: http://domain.com/index.php In my .htaccess I have: Options +FollowSymLinks RewriteEngine On RewriteRule ^([^/]*)$ /index.php?var1=$1 [L] RewriteRule ^([^/]*)/([^/]*)$ /index.php?var1=$1&var2=$2 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /index.php?var1=$1&var2=$2&var3=$3 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ /index.php?var1=$1&var2=$2&var3=$3&var4=$4 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/

How to fix Wordpress redirect issue within Cakephp?

余生颓废 提交于 2020-01-03 03:49:05
问题 I have an older instance of CakePHP installed running my website. WordPress is installed on example.com/blog and used to work fine until I tried to fix another issue where the homepage example.com would redirect to example.com// with double slashes. The issue is that it now redirects to example.com/webroot/blog . Here are my htaccess files and directory structure: /var/www/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ html/webroot/ [L] RewriteRule (.*) html/webroot/$1 [L]