M
M
Manuchehr Jalolov2018-09-16 19:12:07
Apache HTTP Server
Manuchehr Jalolov, 2018-09-16 19:12:07

How to create such a rule in .htaccess?

.htaccess:

RewriteEngine On
ErrorDocument 404 /404.html
RewriteRule ^main /index.php
....

I need a handler for a 404 page, let's say this:
User: opens a non-existent https://yoursite.loc/asdasdasdasdas page in the browser
and .htaccess: https://yoursite.loc/404?link= https://yoursite.loc /asdasdasdasdas
Help, if the option to do this is in .htaccess?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zettabyte, 2018-09-17
@Zettabyte

and .htaccess: https://yoursite.loc/404?link=https://yoursite.loc...

It is not entirely clear what exactly .htaccess is, but since you have PHP, use and and already build further logic based on them. However, I strongly recommend that you display both of them with the help before starting work and see what these variables contain. If my memory serves me right, the contents can be either the same or different, depending on the specific software environment. $_SERVER['REDIRECT_URL']$_SERVER['REQUEST_URI']

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question