All Questions
Tagged with mod-rewrite http
176 questions
0
votes
0
answers
41
views
http to https redireaction problem using .htaccess
I have problem with http to https redirection using .htaccess
I use this code on .htaccess
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=...
0
votes
1
answer
203
views
I want to redirect all my website traffic to "https://www.example.com/index.html"
If someone visits my website like:
example.com
www.example.com
http://example.com
http://www.example.com
https://example.com
https://www.example.com
I want to redirect it to https://www.example.com/...
0
votes
0
answers
88
views
htaccess rewritecond rewriterule http https
I have a website on apache with ssl. I want to redirect the users to the https version but also I need to be able to open the 'http' version when I need it.
For example:
example.com --> has to be ...
1
vote
1
answer
2k
views
Why doesn't my .htaccess file redirect to https? How to fix?
Oh Jesus, I've tried this a million times, a million different ways using Stackoverflow, using blogs, my web host even did it at one point, to no success, or maybe my fiddling with caching broke it.
I ...
2
votes
1
answer
705
views
Google is not indexing https
I have used the http protocol for a long time. After years I implemented a domain certificate. Now I am trying to get the website with the https:// protocol indexed but Google still indexes the http ...
2
votes
1
answer
67
views
htaccess with two indexes for locales
I am using Reactjs client-side, and I have two indexes index.html and indexAR.html I am doing it for SEO for every language make an index.
URL example: example.com/ar/{pages}
URL example: example.com/...
0
votes
0
answers
248
views
how to check an exact match when checking the referer header in .htaccess
I know similar questions have been asked before but I haven't been able to implement any of them successfully. I also know the security implications of using the referer header but i'm okay with that.
...
2
votes
1
answer
100
views
.htaccess - ADD www. & REMOVE .html
Hi! My english is not very good, sorry for any spelling mistakes.
Using .htaccess I want to add www. and remove/hide the .html.
It should look something like this:
BEFORE -- http://example.com/...
3
votes
1
answer
45
views
Is it possible to redirect specific pages of my website (using https) to http?
Aim
I would like to redirect specific pages of my website to http.
Background
I have the following .htacess
Options All -Indexes
RewriteEngine On
RewriteRule ^(.*)\.html $1\.php [L]
RedirectMatch ^/*$...
0
votes
1
answer
49
views
Is there a way to redirect one directory as a root and its siblings as sub directories only via Apache2.4 mod_rewrite?
I must configure an HTTPD Server to serve main site from one of many sub directories, keeping all other to resolve as site sub catalogs. To make it more clear, lets say my root directory looks like ...
0
votes
1
answer
117
views
Force use HTTPS with .COM domain and WWW in .htaccess
I'm trying to do a permanent redirect 301 to all the traffic to a main .com domain.
I have 3 domains:
example.com -> Main Domain
example.net
example.org
Rules are:
Always use https (http -> ...
0
votes
1
answer
69
views
Apache2 redirect https://example.com to https://www.example.com with vhosts
Folks,
I have apache server with vhosts.
For vhosts, I need to redirect http://*.example.com to https://*.example.com and it works as last block in the code.
Reg. the main server, I want to redirect ...
0
votes
1
answer
134
views
redirect http tp https using mod_rewrite on apache 2.2
I have a working mywebsite.com hosting port at 8080. I was able to redirect the port from 8080 to open port 80 using mod_rewrite. Now i have a new requirement to redirect that particular http to https ...
1
vote
1
answer
30
views
Infinite redirections in mod_rewrite when redirected from http to https
The .htaccess file looks like below and works well at redirecting the traffic from website.com/page or website.com/page/ to index.php?site=page, and from website.com/page/subpage/ to index.php?site=...
0
votes
0
answers
29
views
Is there a way to handle a https forwarding to http without a browser error message?
Scenario:
We have two domains, example.com (used as simple Webpage) and example.de (used as a Shop).
The Shop was secured with a ssl certificate und used https connection. We closed the Shop and want ...
0
votes
1
answer
105
views
how convert htaccess deny rule to IIS url rewrite rule
I am converting .htaccess file to rewrite rules in IIS to convert from http to https,
all the rules are being converted which starts with RewriteCond but deny from all is not converted
I want to ...
0
votes
1
answer
64
views
Ignore complete subdomain from https in htaccess
I'm trying to achieve the following thing in my HTACCESS.
I have some lines to force all connections over HTTPS://.
I want to exclude specific subdomains because I don't have SSL on them.
## HTTPS ...
0
votes
1
answer
335
views
CodeIgniter / Lost input data, $_POST is empty too
I am in the process of updating the long overdue CI 2.something to CI 3.1.11. So far so good except for the form data which is lost. Neither $this->input->post('usr') nor $_POST hold any values ...
1
vote
1
answer
671
views
Apache RewriteRule [L] flag ignored
I'm trying to configure Apache rewrite rules. My website directory contains three files
index.html
index2.html
index3.html
I'm using these Apache rewrite rules:
RewriteRule index.html /index2.html [...
0
votes
1
answer
129
views
How to configure one URL Rewrite/proxy rules on IIS?
Architecture:
User --> ARR Server --> LB --> 2 Web Server serving 2 different sites
Web Server1 serving -> https://xxxx-green-xxxx-xxxx.net/xxx/xxx?xx=xxxx where green keyword comes in any place in ...
1
vote
1
answer
28
views
How do i use atoms for path variables in Apache http mod_rewrite?
How do i use the path variables in the source URL to redirect using apache mod_rewrite? In a nutshell,
This works
RewriteRule ^/?sourceURL/path/var1/(.*)$ http://destination/path?var1=$1 [L]
But ...
2
votes
2
answers
92
views
Redirect documentroot to another folder in conf apache or .htccess
Good Day
I want to rewrite a url when request a subdirectory
When the user request
172.0.0.1/url
i want to rewrite to make this url point to
172.0.0.1/url/url
or the documentroot is in /...
0
votes
0
answers
54
views
NodeJs deployment on a site with content already on it
I'm trying to start developing apps with nodejs, I already have a site and a host. The thing that I am hitting a snag on is that I already have content on the site. I'm trying to start with making a ...
1
vote
1
answer
79
views
Redirect http to https on home page only
I read many similar questions but I did not find a solution. I want to redirect HTTP to HTTPS on the home page only.
http://example.com to https://example.com
I don't know anything about .htacces.
...
4
votes
1
answer
235
views
.htaccess redirect to file within directory
Website will be going down for maintenance very soon. In the mean while all visitors will be redirected to a page indicating that the website will be down for a short period of time until maintenance ...
3
votes
1
answer
2k
views
Apache dynamic IP whitelist for specific directory and files
I am trying to whitelist IPs dynamically to grant access to a specific directory. A php script will be constantly modyfying the whitelist.txt file to add/remove entries.
I know the proper way handle ...
1
vote
0
answers
2k
views
Apache Proxypass gives too many redirects error for https to http redirects
I have an Apache 2.4 instance that has ProxyPass configured to point all incoming request with /abc
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</...
0
votes
2
answers
191
views
RewriteRule to remove superfluous single "?" in URL
I am using IBM HTTP server configuration file to rewrite a URL redirected from CDN.
For some reason the URL comes with a superfluous single question mark even when there are no any query string. For ...
0
votes
1
answer
53
views
prestashop URL nonsense redirection
I tried to make my prestashop website secure with https. I made changes in admin (configuration -> main -> Enable SSL & Enable SSL on all pages) and also in .htaccess file. Everything worked ...
0
votes
1
answer
39
views
Can't access website admin panel , https to http migration misconfiguration
Website Backend: codeigniter php
So I was trying to change http to https to my website, My college has a SSL certificate in our college domain in which http was working fine, I added these 3 line to ...
1
vote
0
answers
23
views
.htaccess force http specific sub directories
I have set in my .htaccess file to redirect every url to https.
What i want to add is to exclude it for a specific sub directory
eg: www.mysite.com/myfiles <-- dont force https
eg: www.mysite.com/...
0
votes
1
answer
350
views
websphere and apache server proxy and rewrite configuration
There are javaEE applications run on WebSphere server.
The thing I wanna do that to configure a http server that takes the request and redirect to my local websphere server.
For example:
This is ...
-1
votes
1
answer
504
views
Multiple values RewriteMap prg
I'm not able to pass multiple values through a RewriteMap prg. This is what I have:
RewriteMap encrypt "prg:/bin/python2.7 /var/www/encrypt.py"
RewriteRule /secure ${encrypt:%{LA-U:ENV:email}} [P]
I ...
0
votes
1
answer
88
views
Why the rewrite rule does not convert to GET from OPTIONS
In my website has many JS files and I want if a particular JS is loaded in the browser then rewrite will call a servlet in another domain.
For this I have added following lines :
<VirtualHost *:...
0
votes
1
answer
694
views
rewrite rule not working on https
On apache, I have this rewrite rule under http
RewriteRule ^([^/]*)-([^/]*)\.html$ mypage.php?val1=$1&val2=$2 [L,R=301]
and after, this rewrite rule that move all http page on https
RewriteCond ...
0
votes
1
answer
36
views
HTTP redirect to HTTPS
how can i redirect my site to https?
i already set on cpanel domain -> redirection
and here's my .htaccess code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
...
0
votes
1
answer
85
views
Mod rewrite exclude one route from https redirect
need help with htaccess file. I tried many variants of redirect to HTTPS, but found only one working example, another examples return too many redirects.
My rewrite conditions:
RewriteEngine On
...
0
votes
1
answer
22
views
access the same subdomain using another subdomain without changing url
I have one host, but would like to show a different subdomain. I have 2 subdomain's pointing to the one host. The private subdomain called private.thedomain.com and the public called something like ...
0
votes
1
answer
1k
views
.htaccess redirect HTTP to HTTPS with mod_rewrite not working
I'm trying to redirect all the connections to my website from http to https using htaccess and mod_rewrite, I've tried all the possible things and still not working, I get an error like: The page is ...
0
votes
1
answer
159
views
Apache redirect to ignore folder
I have a self-hosted multi-site Wordpress instance. There are several different domains attached to this instance - but I don't like the way the URL looks.
So, the actual page URL looks something ...
1
vote
1
answer
1k
views
How to force http on specific folder in https site
I have site with https
But I need specific folder should be http.
How can we achieve it ?
e.g.
my site is
https://www.mywebsite.com
I want folder1/subfolder1 should be forced to http://
e.g. ...
0
votes
1
answer
62
views
Forcing 1 URL to use HTTP when the whole site is forced to use HTTPS
Background
I have a website that is forced to use https like this,
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
I have one URL that has to be http to work. It ...
0
votes
1
answer
42
views
Redirect ip request (https or http) to domine (https)
This is my vhost.
<VirtualHost *:80>
ServerName mywebsite
ServerAdmin [email protected]
DocumentRoot /var/www
RewriteEngine On
RewriteCond %{...
0
votes
0
answers
85
views
.htaccess causing errors, error log empty
I have a .htaccess file here that is from open source bitcoin exchange written in php called wlox.
Unfortunately its causing a server 500 error and the error logs are empty.
This is what the file ...
1
vote
2
answers
59
views
Redirecting www.domain.com and domain.com to subdomain.domain.com using httpd
I would like to redirect:
Situation 1. example.com to subdomain.example.com
Situation 2. www.example.com to subdomain.example.com
I have put these 2 chunks of code inside my httpd.conf. Only ...
-1
votes
2
answers
98
views
HTTP_REFERER syntax
I'm using this code
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https://(subdomain\.)?domain\.com/ [NC]
RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|jpeg|doc|xls|pdf|html|htm|xlsx|docx|mp4|...
0
votes
2
answers
5k
views
How to force http
I have the following in a .htaccess file:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://example.com/$1 [R=302,L]
Yet when I go to https://example.com I get an invalid ...
0
votes
0
answers
877
views
Remove the redirect chain from website
my htaccess rewrite code for redirect
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
i am getting this on my pingdoom test:
Remove the following redirect ...
0
votes
2
answers
2k
views
RewriteCond %{QUERY_STRING}
Here's what I'm trying to accomplish:
http://example.com/real-estate/?group=rentals
needs to go to
http://example.com/real-estate/rentals
Here's what I have in my .htaccess that isn't working:
<...