Question QuestionsRedirect 5 URLs to a single one

Questions :question: place them in this section
Previous topicNext topic
User avatar

Topic Author
RazvanAlexandru
Users
Users
Status: Offline
User theme: Dark
Posts: 16
Joined: Jul 16th, '20, 19:57
    Windows 10 Chrome

Redirect 5 URLs to a single one

Post by RazvanAlexandru »

Hello, I've been trying to redirect these 5 URLs to a single one but I couldn't manage to do it and I don't know what else to do. What should I do in order to make it work?

Code: Select all

https://www.realestatebpo.com/index.php?sid=e4966481a9c92c98d40e0e1360015d94
https://realestatebpo.com/
https://realestatebpo.com/index.php
https://www.realestatebpo.com/index.php
https://www.realestatebpo.com/
All pages have 5 different URLs, need to do redirect all to https://www.realestatebpo.com/

I tried with these rules but still nothing:

Code: Select all

RewriteCond %{REQUEST_URI} ^index\.php$ [NC]
RewriteRule ^(.*)$ https\:\/\/www\.realestatebpo\.com\/? [L,R=302]

Code: Select all

RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https\:\/\/www\.realestatebpo\.com\/$1 [L,R=302]

User avatar

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5134
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Redirect 5 URLs to a single one

Post by martin »

Change urls to yours it also depends on your server type.

Code: Select all

#Force www:
RewriteCond %{HTTP_HOST} ^martins-phpbb-test.com [NC]
RewriteRule ^(.*)$ https://www.martins-phpbb-test.com/$1 [L,R=301,NC]

#force https
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.martins-phpbb-test.com/$1 [R,L]

#force no index.php
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
Image

User avatar

Topic Author
RazvanAlexandru
Users
Users
Status: Offline
User theme: Dark
Posts: 16
Joined: Jul 16th, '20, 19:57
    Windows 10 Chrome

Re: Redirect 5 URLs to a single one

Post by RazvanAlexandru »

martin wrote: Mar 11th, '21, 00:45 change urls to yours it also depends on your server type.

Code: Select all

#Force www:
RewriteCond %{HTTP_HOST} ^martins-phpbb-test.com [NC]
RewriteRule ^(.*)$ https://www.martins-phpbb-test.com/$1 [L,R=301,NC]

#force https
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://www.martins-phpbb-test.com/$1 [R,L]

#force no index.php
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
Thank you so much for your help, I really appreciate it
Ok I added those rules, all good for everything but now instead of index.php I have this url: https://www.realestatebpo.com/?sid=bdd2 ... ef50389fb6
Is there something I could do about that?

User avatar

martin
Admin
Admin
Status: Offline
User theme: Dark
Posts: 5134
Joined: Apr 6th, '14, 14:12
    Linux Chrome

Re: Redirect 5 URLs to a single one

Post by martin »

Yes click the logo. Index.php you can hide but sid you cant but click the logo and it will go away.

User avatar

Topic Author
RazvanAlexandru
Users
Users
Status: Offline
User theme: Dark
Posts: 16
Joined: Jul 16th, '20, 19:57
    Windows 10 Chrome

Re: Redirect 5 URLs to a single one

Post by RazvanAlexandru »

martin wrote: Mar 11th, '21, 09:43 yes click the logo. Index.php you can hide but sid you cant but click the logo and it will go away.
Okk, thank you :mml:

Previous topicNext topic