Jump to content


Photo

Masking Addresses..


  • Please log in to reply
5 replies to this topic

#1 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 03 August 2006 - 12:05 AM

Man. This forum has helped me out a ton with my website thus far, much appreciated. One more, (hopefully) quick questions for all your pros.

I just want to know how to mask the web address that appears in a web browser. I simply want to show it as my main domain (http://www.iptresources.com) throughout the entire website. I figure it's as simple as adding a script to each page with what I want to show up, however I don't know what script it is or where I should look for it. Thanks for the help -- in advance!

#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 03 August 2006 - 12:54 AM

I have only ever seen this done with frames.
I do not like this, as if I like one page, I can bookmark that page, or send to a friend. instead of having to go through the whole site again

You can mask your URL in a way
for example
www.example.com/index.php?page=main
to be
www.example.com/page/main
or what ever you want
using Mod Rewrite on a *NIX machine and HTACCESS
Tell me the problem, I will try tell you the solution

#3 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 03 August 2006 - 12:58 AM

Alright, that's cool. I've give it a shot. The main reason why I wanted to do this (well, I was told to do this anyways), was so that visitors didn't know how I've got the website mapped out. I'm not too concerned with them entering sections they're not supposed to, as they have to have a session open and it expires once they close their browser anyways. I just figured it would be a nice thing to do.. however given the fact that I despise frames I definitely won't go that route.

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 03 August 2006 - 01:15 AM

I like your thinking, i hate frames as well, but I thought I be fair and give you the option

Mod Rewrites is easy

in the HTACCESS use the following
RewriteEngine On

then you add the rewrite rule

for example

RewriteRule ^index.php?page=([a-z]*) page/$1 [L]

Where the first bit (index.php?page=([a-z]*) is the real address
([a-z]*) means anything that is a lowercase letter only

then page/$1 is the page you want shown
$1 being the ([a-z]*) bit

Then linking you would do
<a href='/page/main'>Main Page</a>
Instead of <a href='/index.php?page=main'>Main Page</a>

I think that covers the basic concept of Mod Rewrite
Tell me the problem, I will try tell you the solution

#5 vivek

vivek
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 21 September 2006 - 06:46 AM

Hello

I want to know that how can it possible to make a dynamic subdomain using .htaccess file and mod_rewrite ?

My idea is,

I want  to redirect http://subdomain.mydomain.com to http://mydomain.com/...hp?id=subdomain


How can this possible in apache's mod rewrite ?

#6 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 21 September 2006 - 08:43 AM

Hello

I want to know that how can it possible to make a dynamic subdomain using .htaccess file and mod_rewrite ?

My idea is,

I want  to redirect http://subdomain.mydomain.com to http://mydomain.com/...hp?id=subdomain


How can this possible in apache's mod rewrite ?


You can place a index.php file in the root of the sub domain with something like
<?php
header("Location: http://www.exampel.c...direct.php?id=x
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users