473,800 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change url without actually changing it.

Markus
6,050 Recognized Expert Expert
Is there a way i could get

http://somesite.com/viewer/someimage.jpg

to be recognised as

http://somesite.com/viewer/?id=someimage.j pg

I know i could rewrite the url with .htaccess but i don't want to change the lettering in the url.

The thing im trying to get at is;
how myspace do: myspace.com/username
but the 'username' isn't an actual directory.
I'm guesing it is read as myspace.com/?user=username

Hmm, anyone?

Thanks.
Nov 22 '07
12 1795
Markus
6,050 Recognized Expert Expert
I'm not all that experienced with all this, but would it not be possible to replace "([a-zA-Z0-1_-]+)" with "(\w+)"?
I was aware that there was some common expression that could take care of it, but i didn't know what it was.

Thanks Atli.
Nov 25 '07 #11
coffear
20 New Member
I'm not all that experienced with all this, but would it not be possible to replace "([a-zA-Z0-1_-]+)" with "(\w+)"?
Not quite \w is for the following range:-

a-zA-Z0-9_

so misses out the - but of course you could add that in. I personally however prefer whenever possible to use ranges so that it is easier to see what a regular expression does. Unless you specifically know what \w does you will have problems decoding the regexp whereas you have a better chance with actually using the ranges.
Nov 25 '07 #12
Markus
6,050 Recognized Expert Expert
Not quite \w is for the following range:-

a-zA-Z0-9_

so misses out the - but of course you could add that in. I personally however prefer whenever possible to use ranges so that it is easier to see what a regular expression does. Unless you specifically know what \w does you will have problems decoding the regexp whereas you have a better chance with actually using the ranges.
Yeh, i was going to stick with

a-zA-Z0-9_-

For that very reason. Although knowing about \w is helpful for future reference :)
Nov 25 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

3
17313
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting seems to be ignored completely, even when I try with window.setTimeout. So my two questions are: (1) Most important: Is there anything I can do so that I don't have to wait for the next mouse event before the cursor gets repainted. (2) Why...
4
2636
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an QA tested for a new year release. I don't think that going to prove practical, but there is no harm in trying :) and some serious family commitments. But it has to be done soon so this is stage one. Mike Winter provided an extensive list of...
5
7126
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is the printer destination for special reports such as stickers and mailing labels. The Mailing Label report is, of course, designed here for a specific printer (Mailing Label). At another site, the name could be completely different. Other than...
7
1345
by: Peter Oliphant | last post by:
I use to make the statement that you could always replace any 'private' or 'public' access with 'public' and the code would still compile. This is no longer the case. It turns out that in /clr it is not allowed (as far as I can tell) to reduce the access of a virtual method defined in a base class. Thus, if one declares a virtual method in a base class as 'protected' and then proceeded to create derived classes with the virtual method...
6
3121
by: Michelle Stone | last post by:
Hi I am doing a bilingual .NET application for English/Arabic. On a web form, I have some edit boxes for data entry in Arabic and some for entry in English. Right now the user has to change his keyboard language by pressing ALT+SHIFT (or by changing the language manually elsewhere) each time he wants to shift from one language to another.
4
3671
by: K.N.Ranjit | last post by:
Hi to all friends out there, I'm facing this problem for atleast 2 days but still have'nt yet solved my problem.I send the mail few days back (ie) in VB.net how to shift my form coordinates (ie) by default (0,0) is in the top-left corner of the form but right now I need it in the bottom left corner of my form (ie) my (0,0) coordinates.I dont know coding.I tried changing the form property location but this location property is to place...
5
443
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar? ----------------------------------------------------------------------- This text can only be altered by changing the URL of the page. The normal solution is to use frames, though this can introduce problems of its own. ===
45
18913
by: Zytan | last post by:
This returns the following error: "Cannot modify the return value of 'System.Collections.Generic.List<MyStruct>.this' because it is not a variable" and I have no idea why! Do lists return copies of their elements? Why can't I change the element itself? class Program { private struct MyStruct
11
7462
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
2
9457
by: Tamer | last post by:
Hi! Is there a way to change the protocoll type through Javascript without reloading (or making a request from the webserver) via Javascript? for example: http://mydomain.com -https://mydomain.com and backwards (if possible).
0
9695
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
9555
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
10514
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...
0
10287
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10042
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...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7588
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...
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
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.