httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yehuda Katz <yeh...@ymkatz.net>
Subject Re: [users@httpd] mod_rewrite help, # in input url
Date Tue, 21 Jan 2014 21:11:59 GMT
It is not possible. The string after the `#` is NEVER sent to the server
(that is because of the way the browser works and there is nothing the
server can do about it).  The ONLY way to send it to the server would be to
have some client-side scripting that captures and sends it as a real query
string (using a `?`).

- Y


On Tue, Jan 21, 2014 at 4:02 PM, Ayub Khan <ayub.hp@gmail.com> wrote:

> Thank you for the reply. I want to match the text which is  follows #  and
> grab a substring from it. Not sure if its possible with mod_rewrite ?
>
>
> /share/page/repositry/path#filter=xyz%2C%2Fn3%2FUSER%20HOMES%2Fn3%2Fn3555&page=1
>
> From the above url, I nee to redirect to /share/page/MyFiles&page=1
>
> page=1 is variable I need to be captured from source url. Is it possible
> using Extended redirect of Apache ?
>
> Thank you for the valuable clues !!
>
>
> On Tue, Jan 21, 2014 at 9:09 PM, Rich Bowen <rbowen@rcbowen.com> wrote:
>
>>
>> On 01/17/2014 12:49 PM, Ayub Khan wrote:
>>
>>>  Could some one assist me with creating a rewrite rule in httpd 2.2.4?
>>>
>>> http://localhost:8080/share/page/repository#filter=path%
>>> 7C%2FUser%25Homes%2F<2ALFANUMERIC>%2F<ALFANUMERIC>%
>>> 2F<DYNAMICTEXT>%7C&page=1
>>>
>>> http://localhost:8080/share/page/context/mine/myfiles#filter=path%2F
>>> <2ALFANUMERIC>/<ALFANUMERIC>%2F<DYNAMICTEXT>
>>>
>>> Below is sample:
>>>
>>> http://localhost:8080/share/page/repository#filter=path%
>>> 7C%2FUser%2520Homes%2Fm8%2Fm84448%2FTestFolder%7C&page=1
>>>
>>> http://localhost:8080/share/page/context/mine/myfiles#
>>> filter=path%2Fm8%2Fm84448
>>>
>>> I tried to do the rewrite rule however # in the base rule does not seem
>>> to valid
>>>
>>
>> Have a look at the access log. You'll notice that anything after the #
>> isn't actually sent with the request to the server, but is, rather, a
>> client-side "anchor", processed by the browser to find an anchor in HTML
>> markup.
>>
>> Thus, you're not going to be able to write rewrite rules to handle this.
>>
>> Consider, instead, using '?' to pass additional arguments in the query
>> string
>>
>> --
>> Rich Bowen
>> rbowen@rcbowen.com
>> http://rcbowen.com/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
> --
> --------------------------------------------------------------------
> Sun Certified Enterprise Architect 1.5
> Sun Certified Java Programmer 1.4
> Microsoft Certified Systems Engineer 2000
> http://in.linkedin.com/pub/ayub-khan/a/811/b81
> mobile:+966-502674604
> ----------------------------------------------------------------------
> It is proved that Hard Work and kowledge will get you close but attitude
> will get you there. However, it's the Love
> of God that will put you over the top!!
>

Mime
View raw message