I have a htaccess file here
/en/.htaccess
and I would like to make this condition (which for basic htacces inside public_html) work also for a subfolder en
RewriteCond %{THE_REQUEST} /events/eventDetails\.php\?id=(.+)&name=(.+)\sHTTP [NC]
RewriteRule ^ /events/%1/%2? [L,R]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^events/([^/]+)/([^/]+)/?$ /events/eventDetails.php?id=$1&name=$2 [L]
my htaccess starts as follows.
RewriteEngine on
RewriteBase /en/
RewriteRule ^hot-events/?$ hot-events.php [NC,L]
The last line correctly translates the link as www.example.com/hot-events
But I also want this to do the job of the first condition. I mean, when someone uses this link,
https://example.com/en/events/123/abc
he should run a request in this file
https://example.com/en/events/eventDetails.php?id=123&name=abc
Directory structure
root/
├── .htaccess
├── index.php
├── events/
│ └── eventDetails.php
└── en/
├── .htaccess
├── index.php
└── events/
└── eventDetails.php
source
share