Skip to content
Advertisement

Tag: .htaccess

Unwanted backslash on parameter while using RewriteRule

URL Examples: This is my htaccess file So I print_r($_REQUEST) on the index.php file to see what I was getting: My problem is that I don’t want the / showing in the last available parameter It would not add the / if I call the examples above like this: What do I need to change on my rules to have

.htaccess stop directory listing and forward to handler.php

I am trying to implement SEO friendly URLs using .htaccess and PHP. I have achieved 90% of my goal and struggling with just one use case. Here is what happing, when I access the following url it lands on This is perfect and that is what I want because then I manage it myself. The real problem is when I

.htaccess remove URL path segments that are causing an Internal Server Error

The following .htaccess Rewrite below seems working fine if the URL is something like: example.com/news/post-1 However, if the URLs have more parameters, something like: example.com/news/post-1/comment-page-1 (URLs from another version of the website) I will get a 500 Internal Server Error. How I can make it redirect to the related post instead of 500 Internal Server Error? Answer if the URLs

htaccess – Deny access to pdf files in folders

The goal is to restrict direct browser access to all *.pdf various subfolders within a main folder. The subfolder names in which each pdf file reside are numeric only (characters 0-9; Eg. “work/books/112/myfile.pdf”) What I have so far is: RewriteRule ^work/books/([0-9]+)/.pdf)$ [F,L,NC] Where ‘books’ is my main folder and then whatever numeric folders in which pdf files reside, there are.

Redirecting non Safari mobile browser?

I am looking for assistance with coding to detect and redirect a iOS user on any browser other than Safari. I was able to accomplish this via .htaccess, but for iPhone & iPad redirect only, via this: But, I only intend it for non-Safari iOS browsers on iPhone and iPad. Open to other methods than htaccess. Our WebRTC script only

Advertisement