Jump to content

Archived

This topic is now archived and is closed to further replies.

SephirGaine

Masking Addresses..

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!

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.