473,669 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tilde ~ causes problem - URL Rewrite

Hi,

We have implemented URL rewriting in our site. It all went OK till
home page links.

When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.

problem comes now...

on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].

E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....

can anyone please help...?
Dec 26 '07 #1
4 5436
Hi,

solved this either, you have to use complete absolute paths like
http://www.example.com/Images/...., or do it like me :) creare rewrite rules
with regular expressions - rewrite wrong paths to the right ones. I have my
own rewriting module, so it was easy...

Regards,

Lukas Holota

"Harsh Trivedi" <ha***********@ gmail.comwrote in message
news:c3******** *************** ***********@i29 g2000prf.google groups.com...
Hi,

We have implemented URL rewriting in our site. It all went OK till
home page links.

When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.

problem comes now...

on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].

E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....

can anyone please help...?
Dec 26 '07 #2
We have written like this:

1) Place the function to rewrite in global.asax file in Begin request
event
2) Create the function that will be called by step -1
3) Create the xml file for url mapping and use Reg ex
4) Once false path is found for the url,
HttpContext.Cur rent.RewritePat h(newPath)

On Dec 26, 2:35 pm, <l.hol...@hotma il.comwrote:
Hi,

solved this either, you have to use complete absolute paths likehttp://www.example.com/Images/...., or do it like me :) creare rewrite rules
with regular expressions - rewrite wrong paths to the right ones. I have my
own rewriting module, so it was easy...

Regards,

Lukas Holota

"Harsh Trivedi" <harshutriv...@ gmail.comwrote in message

news:c3******** *************** ***********@i29 g2000prf.google groups.com...
Hi,
We have implemented URL rewriting in our site. It all went OK till
home page links.
When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.
problem comes now...
on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].
E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....
can anyone please help...?
Dec 26 '07 #3
Med
Hi,

Try Page.ResolveUrl ("~/Images/Pen.jpg") or
Page.ResolveCli entUrl("~/Images/Pen.jpg") see if it works.
Regards

Med

"Harsh Trivedi" <ha***********@ gmail.comwrote in message
news:c3******** *************** ***********@i29 g2000prf.google groups.com...
Hi,

We have implemented URL rewriting in our site. It all went OK till
home page links.

When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.

problem comes now...

on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].

E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....

can anyone please help...?

Dec 26 '07 #4
I recommend to implement this as an IHttpModule, it's more practical and
easier to implement to other applications

Regards,

L.Holota

"Harsh Trivedi" <ha***********@ gmail.comwrote in message
news:07******** *************** ***********@b40 g2000prf.google groups.com...
We have written like this:

1) Place the function to rewrite in global.asax file in Begin request
event
2) Create the function that will be called by step -1
3) Create the xml file for url mapping and use Reg ex
4) Once false path is found for the url,
HttpContext.Cur rent.RewritePat h(newPath)

On Dec 26, 2:35 pm, <l.hol...@hotma il.comwrote:
>Hi,

solved this either, you have to use complete absolute paths
likehttp://www.example.com/Images/...., or do it like me :) creare
rewrite rules
with regular expressions - rewrite wrong paths to the right ones. I have
my
own rewriting module, so it was easy...

Regards,

Lukas Holota

"Harsh Trivedi" <harshutriv...@ gmail.comwrote in message

news:c3******* *************** ************@i2 9g2000prf.googl egroups.com...
Hi,
We have implemented URL rewriting in our site. It all went OK till
home page links.
When we click on home page category control, where we have implemented
rewriting, it works ok, and open subcategory listing page.
problem comes now...
on the sub category listing page also, we have implemented url
rewriting.... but by all surprize it is showing wrong path where we
have use ~ [tilde].
E.g. ~/Images/Pen.jgp... the ~ should replace with the configured
virtual directory, but it resolves the path of ~ with changed URL
path, that is rewriten.
I am stuck with this problem, all images and hyperlinks having ~ shows
wrong path....
can anyone please help...?
Dec 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2785
by: monte | last post by:
Hello, I need to parse a tilde delimited file and output it to a tabbed delimited file. Example file example.txt data1~data2~data3~data4 data5~data6~data7~data8 I need to extract data2, data4, data6 and data8 from the above file and output it to a file delimited by tabs: data2 data4 data6 data8
0
1103
by: CHristian Niss | last post by:
hi there, in a lot of user controls we are using "~" in server tags to reference objects like images <img src="~/images/something.gif" runat="server" />. with framework 1.0 the tilde got replaced by "/virtualdir" for example. now in framework 1.1 tilde is replaced with relative paths like "../../" this makes a lot of trouble, especially when you dynamically load user controls to an aspx-page. it seems that this relative "../.."-path...
1
3715
by: MB2 | last post by:
I have code in a User Control for an image button like this: <asp:ImageButton id="__0" runat="server" text="Delete" ImageUrl="~/Images/ImageLibrary/icon_delete.gif" /> This used to work and it would display the image properly. However, since installing the latest service pack for the .NET Framework 1.1, the tilde seems to be expanding improperly. The code that is expanded to shows this: <input type="image"...
10
1601
by: Shawn | last post by:
Hi, For a few years, I have been developing each of my clients websites using a seperate web site (unique IP) to solve problems with relative URL's between my local dev station and the production server. Recently, I have needed to collaborate with other developers using Source Safe. But, in order to get source safe working properly, you really need to be working in virtual directories of the default web site.
9
3309
by: Jared Tullis | last post by:
We have an .NET 1.1 application running on 4 2K3 load balanced servers (using WLBS). IIS has the .NET aspnet_isapi.dll mapped as a wildcard application map. The web.config points *.html to a HttpHandler of our design. This setup serves over a million page views daily with almost no hassle whatsoever. We have brought a few affiliates onto our system who have URLs still floating in Google, Y! and other search engines from before they...
2
2739
by: Leif K-Brooks | last post by:
I'm running Python 2.3.5 and 2.4.1 under Debian Sarge. Instead of deleting the character after the cursor, pressing my "delete" key in an interactive Python window causes a system beep and inserts a tilde character. This behavior occurs across all of the terminals I've tried (xterm, Konsole, real Linux terminal), but does not occur when running bash instead of python. Other Readline-provided functionality (moving the cursor, history) seems...
4
14601
by: ibiza | last post by:
Hi all, I have a problem which I don't understand with the "~" mark in a NavigateUrl property of an asp:HyperLink. I have this in a master page, to build the standard menu (rMenuItems is a Repeater): Protected Sub rMenuItems_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
12
1976
by: semut | last post by:
Given that the string is of null terminated type. What could be the possible causes (by experience) the string to have no null terminated and cause buffer overflow later. I know it is quite broad, just like to find out the causes as much as possible so that I could impose stricter checking toward my codes. note: I could not use std::string cause it will require a total rewrite. thanks.
4
4434
by: =?Utf-8?B?QWxm?= | last post by:
Hello all, I am having trouble dealing with ~(tilde) in my .Net 1.1 web application, specially when it comes through the URL. For example, when someone requests the following URL: www.mysite.com/~mypage.aspx, my web application will through the following error (with custom errors turned off): Server Error in '/' Application. --------------------------------------------------------------------------------
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.