Jump to content

Rewrite Url (masking It)


houssam_ballout

Recommended Posts

well, the RewriteRule is directing the page, all what I need is just to fake the URL
The server is responsible for selecting a file to run. It is only after that where you can use that file to do whatever you want, including redirecting the user to another URL or acting as if you are "it".How do you see the server understanding that
sub.site.com/page1/page1.1/

is equivalent to (for example)

sub.site.com/index.html

without you explicitly telling it so?URL mappings MUST be done by the server. No way around it.

Link to comment
Share on other sites

There is no option in any language to change your main domain (sub.site.com) due to security reasons. However, if you mean shortening the URL from 'sub.site.com/page1/page1.1/......' to 'sub.site.com', there are multiple way's in almost any language:If you have complete control over the domain (this means in this case that you can acces a file called: sub.site.com/index.php or index.html) you can do the following in the index.html or index.php (whatever your main file is) with java script:

<script type="text/javascript"><!–window.location = "http://sub.site.com/page1/page1.1/......";//–></script>

above will output the page with the long link but it shows sub.site.com as urlOr do it in php: (witch is better in my opinion)

<?phpinclude("page1/page1.1/......");?>

A simpel, but old and in-efficiënt method is Iframe in html:

<iframe src='page1/page1.1/.....' />

I hope this solved your problem?Okok, there is actually a way to fake an URL from the web but this is called hacking or abusing so it is against the law

Link to comment
Share on other sites

There is no option in any language to change your main domain (sub.site.com) due to security reasons. However, if you mean shortening the URL from 'sub.site.com/page1/page1.1/......' to 'sub.site.com', there are multiple way's in almost any language:If you have complete control over the domain (this means in this case that you can acces a file called: sub.site.com/index.php or index.html) you can do the following in the index.html or index.php (whatever your main file is) with java script:
<script type="text/javascript"><!–window.location = "http://sub.site.com/page1/page1.1/......";//–></script>

above will output the page with the long link but it shows sub.site.com as urlOr do it in php: (witch is better in my opinion)

<?phpinclude("page1/page1.1/......");?>

A simpel, but old and in-efficiënt method is Iframe in html:

<iframe src='page1/page1.1/.....' />

I hope this solved your problem?Okok, there is actually a way to fake an URL from the web but this is called hacking or abusing so it is against the law

how can I implement this?
Link to comment
Share on other sites

The php, javascript and html versions all go between <body></body>I only use javascript functions, meta tags and CSS between the <head></head> tags.
Ah yes you're right. Functions go in the head other stuff in the body. I usually try to stick to that rule, too.
Link to comment
Share on other sites

JavaScript doesn't necessarily have to go in the head; in fact Yahoo's Best Practices for Speeding Up Your Web Site[1] suggest placing the scripts at the bottom of pages.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...