.htaccess

Vue-router on apache, SPA in sub-directory, can only access pages by redirect

妖精的绣舞 提交于 2020-12-28 07:58:32
问题 So I have a Vue app for a client set up on an apache dev server. I am doing this to match the production environment. The app is in a subdirectory and I set the 'base' option on vue-router to match. If I navigate to my virtual host root it redirects properly, however navigating to the same address by typing the address in gives a 404. Here is my router code: const routes = [ {path: '/', redirect: '/london' }, {path: '/:city', component: homeView} ] const router = new VueRouter ({ mode:

Vue-router on apache, SPA in sub-directory, can only access pages by redirect

馋奶兔 提交于 2020-12-28 07:49:23
问题 So I have a Vue app for a client set up on an apache dev server. I am doing this to match the production environment. The app is in a subdirectory and I set the 'base' option on vue-router to match. If I navigate to my virtual host root it redirects properly, however navigating to the same address by typing the address in gives a 404. Here is my router code: const routes = [ {path: '/', redirect: '/london' }, {path: '/:city', component: homeView} ] const router = new VueRouter ({ mode:

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

How to remove 'public' from Laravel URL hosted on child folder?

限于喜欢 提交于 2020-12-15 19:36:20
问题 I have a Laravel 5.3 project on shared hosting located at the following address. How to remove the public from URL? Now the same question was asked at Remove public from URL Laravel 5.3 on shared hosting but many answers were asking to move all public content to root domain, but my root domain is already hosting something with index.php in it. Can you please tell me how to do it? All other information is same as the question shared, i.e default .htaccess file in public as well as home

How to remove 'public' from Laravel URL hosted on child folder?

。_饼干妹妹 提交于 2020-12-15 19:33:49
问题 I have a Laravel 5.3 project on shared hosting located at the following address. How to remove the public from URL? Now the same question was asked at Remove public from URL Laravel 5.3 on shared hosting but many answers were asking to move all public content to root domain, but my root domain is already hosting something with index.php in it. Can you please tell me how to do it? All other information is same as the question shared, i.e default .htaccess file in public as well as home

Prevent Direct Url Access from Node.js Application

隐身守侯 提交于 2020-12-15 05:56:14
问题 I deployed Node.js application to linux server, and it works well. But, I can direct access to specific file in browser to typing url. http://my-node-app.com/package.json I can see all the things, even if http://my-node-app.com/config/config.json It shows my configuration include password. It would not shown except server itself, how can I restrict access? I added .htaccess file in var/www/, and added this code, <Directory "my-node-app"> Deny from all </Directory> But it not works, and I

htaccess problem 404 not found

喜夏-厌秋 提交于 2020-12-14 06:29:16
问题 I have rewrite URL like following RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.example$ RewriteRule (.*) /subdomain/$1 [L] RewriteRule ^a/(.*)/(.*)$ search.php?searchtext=$1&locationtext=$2 [NC] And I want to call my page like http://kolkata.mydomain.example/a/phptraining/Kolkata But when page is opening this is saying 404 not found. I’m not understanding this error. 回答1: With this rule set only the first rule is probably applied but not the second. Try the first rule without L flag and

Prevent admin directory from redirecting using url rewrite rules

僤鯓⒐⒋嵵緔 提交于 2020-12-13 03:45:27
问题 The below setup works very well but if I try to go to https://example.com/quotes/wp-admin it redirects me to https://example.com/wp-admin which isn't what I want to happen because now I can never log into the /quotes/ WordPress website. I tried adding this to the quotes .htaccess but it doesn't help: RewriteCond %{REQUEST_URI} !^/(wp-admin/.*)$ I also tried adding the following line to a .htaccess file in the wp-admin folder but it also did not work. RewriteEngine Off Root .htaccess file: #