Forum Moderators: phranque

Message Too Old, No Replies

Help with .htaccess please

         

Jovetic

10:56 am on Jan 5, 2008 (gmt 0)

10+ Year Member



Hi all,

I am very new at all this domain stuff, i mean i only looked at html on tuesday now i have come across this stuff im lost.

Basicaly what i am trying to do is remove the ccgi.example.co.uk so i can get a clean address like http://www.example.co.uk/forums

The way i have everything laid out is:

CGI Server

[ccgi.example.plus.com...] points to [ccgi.example.co.uk...]

/files/home3/jovetic/forums/[phpbb3 forums here]

forums
.htaccess

Then on my web domain i have

http://www.example.co.uk

/htdocs
forums
scripts
images
index.html ect

Here is the code i found, i changed it slightly to reflect my servers ect.

RewriteEngine On
RewriteCond %{HTTP_HOST} ccgi\.example\.plus\.com$
RewriteCond %{REQUEST_URI} ^(.+[^/])$
RewriteCond /files/home3/example/forums%1 -d
RewriteRule (.+[^/])$ /$1/ [r=301,l]
RewriteCond %{HTTP_HOST} ccgi\.example\.plus\.com$
RewriteCond %{REQUEST_URI}!^/ccgi
RewriteRule ^(.*)$ /forums/$1 [l]

RewriteCond %{HTTP_HOST} example2\.com$
RewriteCond %{REQUEST_URI} ^(.+[^/])$
RewriteCond /files/home3/example/example2%1 -d
RewriteRule (.+[^/])$ /$1/ [r=301,l]
RewriteCond %{HTTP_HOST} example2\.com$
RewriteCond %{REQUEST_URI}!^/examplev2
RewriteRule ^(.*)$ /example2/$1 [l]

Can anyone see where i went wrong please? I have tried a couple different types of variations. But to be honest i dont fulyl understand of it, im not even sure if the code would even work as the guide i took it from doesnt seem to amke sense and the way i interperate the code does not seem like it would work. Confused :P

[edited by: jatar_k at 1:05 pm (utc) on Jan. 5, 2008]
[edit reason] removed specifics [/edit]

phranque

12:52 pm on Jan 5, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], jovetic!

you should start with the minimum code to do the "domain canonicalization" and then add from there.
you should find plenty of information here if you search on that phrase [google.com].

also you should describe the response you got vs. what was expected from the request (including the response status chain if possible).

Jovetic

1:18 pm on Jan 5, 2008 (gmt 0)

10+ Year Member



Thanks for the welcome :) Will take a look at it now

Jovetic

3:24 pm on Jan 5, 2008 (gmt 0)

10+ Year Member



oh man i got so lost in all that, i think i got some learning to do. Could someone just explain the process a little please?

From teh way i would i assume it, but im thinking im wrong. by putting .html in a folder on my main site which gives a command to go to the cgi server and retrieve it from there and display it back on my main site, am i barking up the wrong tree here?