Jump to content
[MUST READ] Forum Rules ×

Remove ?i= from your domain! (PHP)


xpde

Recommended Posts

Since people wanted to complain about this stuff, why not just remake it in a language they might understand more fluently. This code snippet will destroy of your pesky GET parameter (?i=[1-100]). Here's how to do so - 

Create the Document

  1. Go into your FTP and create a file (preferably ~ deleteGET.php)
  2. Copy and paste this code into the document
<?php
// Just simply add your own GET parameters to remove.
$toRemove = array( 'i' => '', 'anotherGetParam' => '' );
$removeParam = array_intersect_key( $toRemove, $_GET );

// Stabilize website / avoid loop
if(sizeof( $removeParam ) > 0 ) {
	$redirectUrl = $_SERVER[ 'REQUEST_URI' ]; // Server Request
	foreach( $removeParam as $key => $val ) $redirectUrl = preg_replace( '/([?&])' . $key . '=[^&]+(&|$)/', '$1', $redirectUrl ); // Removes every parameter set in $toRemove
	header( 'Location: ' . $redirectUrl ); // Redirects you to final size
}
?>

Include the document

  1. go into your whatever document you want (typically your index.php)
  2. Copy and paste this code to the top of the page
<?php
	include 'deleteGET.php'; // Change to the directory and filename of your code.
?>

Vwolla!

Now you can use Ads, WordPress, and ETC. without having to deal with all the GET Parameters getting deleted/hidden.

Link to comment
Share on other sites

On 3/1/2018 at 1:17 AM, PlanetCloud said:

Also the word deleteGET.php could easily get missunderstood (I know we can change this but just a comment)....
You should make it delete-the-i-thingy.php

xD

No. I personally disagree with your opinion.

Link to comment
Share on other sites

  • 1 month later...
On 2/28/2018 at 6:51 PM, xpde said:

Since people wanted to complain about this stuff, why not just remake it in a language they might understand more fluently. This code snippet will destroy of your pesky GET parameter (?i=[1-100]). Here's how to do so - 

Create the Document

  1. Go into your FTP and create a file (preferably ~ deleteGET.php)
  2. Copy and paste this code into the document

<?php
// Just simply add your own GET parameters to remove.
$toRemove = array( 'i' => '', 'anotherGetParam' => '' );
$removeParam = array_intersect_key( $toRemove, $_GET );

// Stabilize website / avoid loop
if(sizeof( $removeParam ) > 0 ) {
	$redirectUrl = $_SERVER[ 'REQUEST_URI' ]; // Server Request
	foreach( $removeParam as $key => $val ) $redirectUrl = preg_replace( '/([?&])' . $key . '=[^&]+(&|$)/', '$1', $redirectUrl ); // Removes every parameter set in $toRemove
	header( 'Location: ' . $redirectUrl ); // Redirects you to final size
}
?>

Include the document

  1. go into your whatever document you want (typically your index.php)
  2. Copy and paste this code to the top of the page

<?php
	include 'deleteGET.php'; // Change to the directory and filename of your code.
?>

Vwolla!

Now you can use Ads, WordPress, and ETC. without having to deal with all the GET Parameters getting deleted/hidden.

Thanks Buddy.

Link to comment
Share on other sites

  • 1 month later...

Hello, there is a much simpler way to do that, without PHP or .htaccess code, as I posted it in another similar topic here.

Follow my steps and you should be OK:

  • Enable CloudFlare through vPanel or by changing Nameservers
  • Select Full SSL/Flexible (NOT RECOMMENDED)/Full SSL Strict (IF YOU HAVE INSTALLED YOUR OWN CERTIFICATE)
  • Wait for 1-24 hours

It should be gone!

Please tell me if this worked for you or if you found it helpful.

Link to comment
Share on other sites

2 hours ago, PCTipsGR said:

Hello, there is a much simpler way to do that, without PHP or .htaccess code, as I posted it in another similar topic here.

Follow my steps and you should be OK:

  • Enable CloudFlare through vPanel or by changing Nameservers
  • Select Full SSL/Flexible (NOT RECOMMENDED)/Full SSL Strict (IF YOU HAVE INSTALLED YOUR OWN CERTIFICATE)
  • Wait for 1-24 hours

It should be gone!

Please tell me if this worked for you or if you found it helpful.

If you enable cloudflare on your webhost, it will mess with the registration and make it unavailable for users to sign up.

Link to comment
Share on other sites

23 minutes ago, xpde said:

If you enable cloudflare on your webhost, it will mess with the registration and make it unavailable for users to sign up.

What do you mean? I have contacted personally Support and they said that if you use securesignup.net as register domain instead of order.yourdomain.com it will work properly, and so it does!

Link to comment
Share on other sites

14 minutes ago, PCTipsGR said:

What do you mean? I have contacted personally Support and they said that if you use securesignup.net as register domain instead of order.yourdomain.com it will work properly, and so it does!

Tell that to the people who said otherwise

Link to comment
Share on other sites

1 hour ago, PlanetCloud said:

Me xD

It will break it, if you don't belive it, then try it!

How does it break your site?
All the traffic is going to be routed by Cloudflare (Since you must point your nameserver to cloudflare) and this means that if a new user signed up lets say user1.yourdomain.com, even after 72 hours, user will still get a DNS not found error.
Why? Because whenever user access user1.yourdomain.com, cloudflare is going to check it's own DNS records and found none because you had to ADD IT MANUALLY every time a user signed up.

This might sound easy but after a few days you will get sick of it.

Why not use cloudflare API to do this? (You say)
Well you need to put the subdomain name in the A record but you also need the IP address which is diffrent for most account.
User 1 can have ip of 1.1.1.0 and user 2 can have 1.1.1.654.123 and so on (The IP is randomly assigned).
Also you had to deal with server IP changes and you had to RECHECK all the previously signed up user A records for this...

 

:)

 

 

I mean, when you use the CloudFlare integration on vPanel.

Link to comment
Share on other sites

6 hours ago, PlanetCloud said:

Me xD

It will break it, if you don't belive it, then try it!

How does it break your site?
All the traffic is going to be routed by Cloudflare (Since you must point your nameserver to cloudflare) and this means that if a new user signed up lets say user1.yourdomain.com, even after 72 hours, user will still get a DNS not found error.
Why? Because whenever user access user1.yourdomain.com, cloudflare is going to check it's own DNS records and found none because you had to ADD IT MANUALLY every time a user signed up.

This might sound easy but after a few days you will get sick of it.

Why not use cloudflare API to do this? (You say)
Well you need to put the subdomain name in the A record but you also need the IP address which is diffrent for most account.
User 1 can have ip of 1.1.1.0 and user 2 can have 1.1.1.654.123 and so on (The IP is randomly assigned).
Also you had to deal with server IP changes and you had to RECHECK all the previously signed up user A records for this...

 

:)

 

 

However, when you use the cloudflare from VPanel then you don't have to care about A Records. They will automatically pointed to ip when a new user signed up. It will not break your website in any way when you use it from VPanel. But default singup.php don't work under https (SSL)

Link to comment
Share on other sites

2 hours ago, Aqib said:

However, when you use the cloudflare from VPanel then you don't have to care about A Records. They will automatically pointed to ip when a new user signed up. It will not break your website in any way when you use it from VPanel. But default singup.php don't work under https (SSL)

That's why you HAVE TO change order.yourdomain.com to securesignup.net!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...