regexp modrewrite

M

marc

Hi,

Im trying to use modrewrite and apply it to any address of the format:

domain.com/whatever

but not applicable to:

domain.com/whatever.something
or
domain.com/whatever/something/

What is the correct regexp for this pls, Im currently using /([^/]+)
and that grabs everything after the /

Thanks!
M
 
J

Jürgen Exner

marc said:
Im trying to use modrewrite and apply it to any address of the format:

modrewrite? Excuse my ignorance, but I've never heard of it.
domain.com/whatever

but not applicable to:

domain.com/whatever.something
or
domain.com/whatever/something/

What is the correct regexp for this pls, Im currently using /([^/]+)
and that grabs everything after the /

Why not
(undef, $tail) = split (/\//, $URL, 2);
$tail now contains everything after the first slash.

jue
 
T

Tim Greer

marc said:
Hi,

Im trying to use modrewrite and apply it to any address of the format:

domain.com/whatever

but not applicable to:

domain.com/whatever.something
or
domain.com/whatever/something/

What is the correct regexp for this pls, Im currently using /([^/]+)
and that grabs everything after the /

Thanks!
M

This is better asked in alt.apache.configuration. Anyway, the ([^/]+)
will indeed grab one or more character that's not a /, but you didn't
also add . to the char class. Also, /([^/]+) doesn't seem to show how
far that match goes. Is it /([^/]+)$ (ending the string $) or
something else?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
EmeliaBryc

Latest Threads

Top