Jump to content

Masking Addresses..


SephirGaine

Recommended Posts

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!
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 1 month later...
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/redirect.php?id=subdomain


How can this possible in apache's mod rewrite ?
Link to comment
Share on other sites

[quote author=vivek link=topic=102800.msg438529#msg438529 date=1158821188]
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/redirect.php?id=subdomain


How can this possible in apache's mod rewrite ?
[/quote]

You can place a index.php file in the root of the sub domain with something like
<?php
header("Location: http://www.exampel.com/redirect.php?id=x
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.