A
A
Alisher Aidarkhan2019-06-05 08:14:59
htaccess
Alisher Aidarkhan, 2019-06-05 08:14:59

How to redirect to a specific word in a URL (htaccess)?

The project has an api folder . Inside this folder are two files index.phpand mobile.php.
You need to do a redirect. If the user knocks on it, /api/get-coursesit should be redirected to index.php. And if /api/mobile.php/get-coursesonmobile.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-06-05
@shambler81

RewriteRule ^api/get\-courses$ /api/index.php? [L,R=301]
RewriteRule ^api/mobile\.php/get\-courses$ /api/mobile.php? [L,R=301]

And bring the task to life, at least 3 errors in the TOR, so I had to think it out, at least show the correct urls, it was now

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question