.htaccess

Combining rewrites for non-www/ssl/trailing slash with upper->lowercase in .htaccess

那年仲夏 提交于 2021-02-07 09:02:28
问题 So I have a straightforward rewrite to catch non-www URLs, non-SSL urls and urls missing a trailing slash to redirect to SSL, www and trailing slash using: <IfModule mod_rewrite.c> RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} ^(.*)$ [NC] RewriteCond %{HTTP_HOST} ^(.*[^/])$ [NC] RewriteRule (.*\/)$ https://www.tierpoint/$1 [R=301,L] RewriteRule (.*[^/])$ https://www.tierpoint/$1/ [R=301,L] </IfModule> I'd like to add a rewrite to drive uppercase

htaccess - Redirect to subfolder without changing browser URL

早过忘川 提交于 2021-02-07 07:56:11
问题 I've a domain that contains a subfolder with the web app structure. I added a .htaccess on my root domain to point the public folder on my subfolder web app. It works fine, but when I type www.example.com the browser URL changes to www.example.com/subfolder/public , but I would like that it doesn't change. This is my .htaccess : RewriteEngine On RewriteRule ^.*$ subfolder/public [NC,L] EDIT This first .htaccess is used to redirect on subfolder/public, where there is an other .htaccess that

htaccess - Redirect to subfolder without changing browser URL

那年仲夏 提交于 2021-02-07 07:55:06
问题 I've a domain that contains a subfolder with the web app structure. I added a .htaccess on my root domain to point the public folder on my subfolder web app. It works fine, but when I type www.example.com the browser URL changes to www.example.com/subfolder/public , but I would like that it doesn't change. This is my .htaccess : RewriteEngine On RewriteRule ^.*$ subfolder/public [NC,L] EDIT This first .htaccess is used to redirect on subfolder/public, where there is an other .htaccess that

Downloading files with download.php

↘锁芯ラ 提交于 2021-02-06 11:41:28
问题 I need to deliver big files like file.zip (~2 GB) to customers, with a unique URL for each customer. Then I will redirect (with .htaccess ) a customer download link example.com/download/f6zDaq/file.zip to something like example.com/download.php?id=f6zDaq&file=file.zip But as the files are big, I don't want the fact that PHP processes the downloading (instead of just letting Apache handle it) to be a CPU / RAM performance issue for my server. After all, asking PHP to do it involves a new layer

Forcing http using .htaccess

早过忘川 提交于 2021-02-05 20:10:44
问题 This is the script I have right now, how do I have my script force all traffic to http, currently it is doing the exact opposite, it is forcing all traffic to https. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I've also tried this and it didn't work RewriteEngine On RewriteCond %{HTTP} !=on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I got this error: Too many redirects occurred trying to open www.blankpage.com . 回答1: You

Forcing http using .htaccess

∥☆過路亽.° 提交于 2021-02-05 20:10:03
问题 This is the script I have right now, how do I have my script force all traffic to http, currently it is doing the exact opposite, it is forcing all traffic to https. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I've also tried this and it didn't work RewriteEngine On RewriteCond %{HTTP} !=on RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I got this error: Too many redirects occurred trying to open www.blankpage.com . 回答1: You

How to use .htaccess for beautiful links [duplicate]

て烟熏妆下的殇ゞ 提交于 2021-02-05 12:28:03
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: .htacces to create friendly URLs. Help needed I am using ids to display the records (profiles ) of members. So /profile.php?id=1 displays the data of member with id 1. But these urls are ugly and not SEO friendly either. I want change the urls to the format profiles/membername (membername is a unique alias for each member already stored in the db). How can I achieve this link structure through .htaccess? 回答1:

how to hide index.php and controller name in codeigniter by htaccess

感情迁移 提交于 2021-02-05 12:23:31
问题 i want to hide index.php and controller name from my codeignier url website also i want to replace this term ?seo=test-product ad /test-product i have mention my htaccess file below please guild me how to fix this issue i have tried many things none helps RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %

how to hide index.php and controller name in codeigniter by htaccess

ぃ、小莉子 提交于 2021-02-05 12:22:09
问题 i want to hide index.php and controller name from my codeignier url website also i want to replace this term ?seo=test-product ad /test-product i have mention my htaccess file below please guild me how to fix this issue i have tried many things none helps RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %

Edit HTACCESS file to prevent direct access to a particular file within a particular folder

这一生的挚爱 提交于 2021-02-05 10:01:46
问题 I am trying to prevent direct access to a particular file within a sub-folder. I realize that there are MANY topics depicting similar issues here on this forum. But, mine seems to be a bit awkward........due to my already existing HTACCESS file. Here is the file-path to the file : www.example.com/PRINCIPAL/PROJECTS/my_file.php ( my_file.php is the file I want to restrict from direct access) What I mean is : my_file.php is current accessible only if the user navigates through a particulae