Jump to content

[SOLVED] Rewrite and Page Anchors


skyer2000

Recommended Posts

The following is my htaccess file

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)/(.*) content.php?category=$1&urlrewrite=$2 [L]

RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

 

What I'm trying to figure out is how to handle page anchors, for example- content.php?category=all&urlrewrite=short#middlepage. How can I go about this? What modifications to the htaccess file?

Link to comment
https://forums.phpfreaks.com/topic/56449-solved-rewrite-and-page-anchors/
Share on other sites

I modified the code on the smoothscroll to go to an anchor without ever putting the anchor in the URL, for example /all/short. This breaks screenreaders however, which require /all/short#middle. I've noticed pages use URL's such as /all/short/#middle, but I can't figure out how to do that in the htaccess file.

Because its pretty much impossible to explain clearly, and I've yet to find a solution online after constant searching, here is an example of what is happening.....

 

Click on one of the "Quick Links" to see for yourself (the smoothscroll javascript has nothing to do with the problem)

 

http://dev.fansn.com/services/psychiatric

 

 

I hope someone has an idea of why this is happening!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.