Welcome to Geeklog, Anonymous Tuesday, July 16 2024 @ 08:15 am EDT

Geeklog Forums

redirecting URL problem


Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
Hi i want that if someona comes from my second url to my site he would be redirected to my first url

Is it possible to do some hack code in index php in public_html

please give me the detailed instruction please
Problem is i can not login if i came from second url that points to the same geeklog.

thank you
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
This is best done on the server (we had a redirect hack in earlier versions of Geeklog and it caused a lot of problems ...).

If you're on an Apache webserver, put this in your .htaccess:
Text Formatted Code
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*) http://www.example.com/$1 [L,R]
 

Obviously replacing "www.example.com" with the domain name of your site.

bye, Dirk
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
where is that file exactly is it on server do i have to use mysql
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.alternativecomplementarymedicine.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*) http://www.altermedicine.org/$1 [L,R]


i put this in a txt file in my public html

the file name is htaccess.txt and it is not working
did i do a mistake
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
Quote by garfy:
the file name is htaccess.txt and it is not working
did i do a mistake

YES!
.
.
.
.
ok, ok... the filename must be ".htaccess" nothing more and nothing less Smile

geKow
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
I chenged the file nam on server and it disapeared and i can not find it

and at the same time i can not open my site anymore

WHERE is the file gone

 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
wich program are you using to access your server? Since .htaccess is rated as a system file, it is hidden under some circumstances. So if you have an option to show hidden files in your ftp, it should be back.

geKow
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
Quote by geKow: wich program are you using to access your server? Since .htaccess is rated as a system file, it is hidden under some circumstances. So if you have an option to show hidden files in your ftp, it should be back.

geKow


Ok i see it is hidden file but website is not working i get the mesage it can not be open because URI was overstepped or something

I put this inside
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.alternativecomplementarymedicine.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*) http://www.altermedicine.org/$1 [L,R]

i want the first domain to be redirected into the second so is everything ok or mistake again
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
This stuff is so hard

I managed to fix it 50 %

It redirects from second to first now, but if i try to open first url directly it puts me into this

http://www.alternativecomplementarymedicine.com//home/altermed//public_html/

why it puts me into home directory
 Quote

Status: offline

garfy

Forum User
Full Member
Registered: 01/02/05
Posts: 437
Location:EU
OK now i fixed it 70 %

It redirects ok but i can not login, what is wrong??

I tried to change site setting url to this new one and the site was without layout

also i tried to change cookie url and nothing opened

 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Both domain namens in the .htaccess should be the same - the one you want to use for your site. And you should use that same domain in $_CONF['site_url'] then.

bye, Dirk
 Quote

All times are EDT. The time is now 08:15 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content