skip to Main Content

.htaccess RewriteRule gives right link but also a 404 – Apache

I'm hosting different sites http://example.nl/example.nl/_sites/byos/ http://example.nl/example.nl/_sites/eggbot/ http://example.nl/example.nl/_sites/hslab/ http://example.nl/example.nl/_sites/prolactin/ And yes there is a folder that has the same name as the domain, there is a reason for that. And I want the links to become: http://example.nl/byos/ http://example.nl/eggbot/ http://example.nl/hslab/ http://example.nl/prolactin/ This…

VIEW QUESTION

How rewrite url in htaccess – Apache

Good Morning, I have documents within the structure of my website, which are accessed with the following url format: http://example.com/docs/files/123/mydoc.pdf http://example.com/docs/files/475/otherdoc.pdf I want when a url of the above type is accessed, it is renamed with the following format: http://example.com/123/mydoc…

VIEW QUESTION

Use nginx to convert a URL with parameters to pretty links, but at the same time allow PHP to access the parameters

I have an index.php file inside a directory on my server running nginx. It does some currency conversion calculations. I need to be able to send a GET request to this file that includes 5 URL parameters. Example: https://example.com/conversion/index.php?countryfrom=US-United+States&countryto=IN-India&amount=123&amount_type=USD&recv_amount=INR But…

VIEW QUESTION

Replace query string with file extension using htaccess Rule – Apache

I have this link https://career.guru99.com/top-50-c-sharp-interview-questions-answers/?format=pdf I want to redirect it to https://www.guru99.com/pdf/c-sharp-interview-questions.pdf I created the following htaccess rule RewriteCond %{QUERY_STRING} format=pdf [NC] RewriteRule ^c-sharp-interview-questions.html /pdf/c-sharp-interview-questions.pdf? [R=301,L] But the challenge is I have 100+ links and I will have to manually…

VIEW QUESTION
Back To Top
Search