Forum Moderators: phranque

Message Too Old, No Replies

readme.php#link --> readme.php?id=link

         

attiba

3:30 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



I have a lot of links from anywhere to my old (Huge) readme.php file and can not inform each one that links to this Website that I am about to create a new dynamic website. Therefore I would like to redirect like this:

readme.php#link --> readme.php?id=link

I think it could be done with Rewrite but I donīt know how. Please Help.

Attila

jd01

7:30 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi

Welcome to WebmasterWorld.

I am not sure I understand exactly what you are needing.

Could you please post an examplified URL from the 'old' site and a similar examplified URL from the new site, along with a sample of code that you have tried... We try not to code on demand here, but help you out with portions of your code that are not working as you would like them to.

Justin

vincevincevince

7:33 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As I understand it, the #xyz is not available to Apache. In fact I'm fairly certain about it.

If Apache never knows about it you will never be able to act on it.

Just think of clicking a # link on a site - it doesn't even reload the page.

attiba

5:45 am on Jun 24, 2005 (gmt 0)

10+ Year Member



vincevincevince: I hope you are not right about this but it makes sence.

___________________________________
jd01: First of all, itīs a great feeling to becomed welcomed in a new Forum - Thanks!

Old Url:
[www2.uibk.ac.at...]

New Url: (File doesnīt exsit yet, jus want to se how the Apache solves the URL)
[www2.uibk.ac.at...]

My .htaccess try:
RewriteEngine on
RewriteRule readme\.php\#([az-A-Z0-9]+)$ readme.php?id=$ [L]

jdMorgan

7:42 pm on Jul 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code is close.

.htaccess located at http://www2.example.ac.at/.htaccess:


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^ub/readme\.php\#([a-z0-9]+)$ /ub/readme.php?id=$1 [NC,L]

You may need to add the Options line shown above -- it depends on your server configuration.

However, I agree that named anchors (#anchor_name) are handled entirely within the browser, so this may not work.

Jim