Am having redirecting problem


#1

am using this code to redirect from my site domain name to the index page
http gamehup.com to https gamehup.com/browser-games/index
but the only problem is that it redirects the users first to
https gamehup.com and then to HTTP:/gamehup.com/browser-games/index then to https gamehup.com/browser-games/index
I want it to redirect directly to the secure version of the index page this is my rewrite rule

# redirect from the subdomain to the website
 RewriteCond %{HTTP_HOST} ^gamehup.000webhostapp.com[NC,OR]
 RewriteCond %{HTTP_HOST} ^www.gamehup.000webhostapp.com[NC]
# urls without file extintion 
 RewriteRule ^(.*)$ https  gamehup.com[L,R=301,NC]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^([^\.]+)$ $1.php [NC,L]

# changing the default index page
RewriteBase /
#only for the root directory
RewriteCond %{REQUEST_URI} ^/$
#if the uri is not already index.php
RewriteCond %{REQUEST_URI} !^/browser-games/index [NC]
RewriteRule ^$ /browser-games/index    [R=301,L]

# rederct the www to none www 
RewriteCond %{HTTP_HOST} ^www\.gamehup\.com[NC]
RewriteRule ^(.*)$ https  gamehup.com/browser-games/index [L,R=301]

and am using cloudflary to redirect to https


I can't enter some of my website pages when i activated cloudflary SSL
#2

@ayu can you please help me with this


#3

Try this code
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?gamehup\.fix [NC] RewriteRule ^(.*)$ https://gamehup.fix/browser-games/index/$1 [R=301,NC,L]


#4

hello everyone,
anyone knows how to appoint my domain (hosted in networking solutions) to my page https://logicom.000webhostapp.com/ without loosing the txt and mx configuration? when I point in my domain servers to ns01.000webhost.com
and ns02.000webhost.com i lost all the configurations, please help folks.


#5

check this tutorial on how to point a domain name hosted else where to 000webhosting and you will not lose anything


#6

how can I redirect from http://gamehup.com to https://gamehup.com/browser-games/index


#7

Try this:
Copt this in your .htaccess file

RewriteEngine on
RewriteOptions inherit

RewriteCond %{HTTP_HOST} ^gamehup.com$ [NC]
RewriteRule ^(.*)$ https://gamehup.com/browser-games/index$1 [R=301,L]




#8

it keep looping the url in the url bar when i used the code below
https://gamehup.com/browser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/indexbrowser-games/index.php


#9

check my .htaccess write rules above and see if the code you give me complete with it


#10

cuz right now am having the problem that every redirect on my htaccess file redirect 3x and it will be very good for me if it was 2x


#11

and am appalling always use https and automatic https rewrite on cloudflary page rule does this have anything top do with the redirect


#12

May be that’s because you’ve to add a script to remove file extension too.

Anyhow I see that you’ve already fixed it by yourself. :slight_smile:


#13

iv’e fixed the new problem by retiring to the old problem it still redirecting me 4 times. i need it to redirect from the domain to https://gamehup.com/browser-games/index right now it redirect from the domain to the HTTP version of the domain then to the https version of the domain then to the HTTP version if the index page then to the https version of the index page above and that lots of redirecting


#14

is your issue fixed or are you still facing the same?? :sweat_smile:


#15

according to gtmetrix am still having the same issue


#16


this is screen shut from gtmetrix


#17

I guess that’s the http->https transition .


#18

so it can’t be fixed. and another thing i want to change my website to ajax site using ajax to load pages. will it effect my website in a good or a bad way and thanks


#19

Should be in a good way :slight_smile:


#20

OK then thanks, another q let’s say am from country where no papal payza payneer visa card or any type of card allowed, and i want to buy a premium web hosting how can i do that.i know it’s missed up