Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Link with # in pdf file opens as in browser, Rewrite solution?

$
0
0

Replies: 0

In a pdf I pasted the link https://www.domain.com/page-title/#signup
When clicking in this link, the browser converts the # to %23, which makes the url invalid: https://www.domain.com/page-title/%23signup and gets the 404 page.

With the help of these links:
https://perishablepress.com/redirecting-hash-fragments-htaccess/
https://stackoverflow.com/questions/2438509/how-to-rewrite-a-url-with-23-in-it
I created this Rewrite rule in the .htaccess files but no luck so far.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{QUERY_STRING} ^id=1$
RewriteCond %{REQUEST_URI} %23signup\d+$
RewriteRule ^/(.*)%23signup$ /$1#signup [R=301,L,NE]

</IfModule>

# END WordPress

Could anyone help me out please?
Thanks in advance.

  • This topic was modified 1 minute ago by MPdev.

Viewing all articles
Browse latest Browse all 59525

Trending Articles