Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
DirectAdmin Apache - .htaccess rewrite(s)

I'm having trouble setting up a rewrite and hoping someone knows the answer.

This is the code that i'm currently using in .htaccess:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /point/to/dir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(\d+/.*)$ https://domain.ext/point/to/dir/module/status.php?id=$1 [L,QSA]

The client is requesting domain.ext/point/to/dir/ from the server, which should be rewritten to https://domain.ext/point/to/dir/module/status.php.

It is possible that a query is added to the end of the /point/to/dir/ request, which should be appended to https://domain.ext/point/to/dir/module/status.php. The /point/to/dir/ is a non-existing location on the server.

No matter what I do, I keep getting internal server errors (incorrect .htaccess configuration/syntax) or 404's. Hope someone can help out.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

With your shown samples, have your htaccess Rules file in following manner. Make sure you change your path from point/to/dir to your actual path(DO NOT put / in front of it in rule else that wouldn't work).

This is assuming that your point/do/dir has module folder and index.php inside module folder too.

Make sure to clear your browser cache before testing your URLs.

Options +FollowSymLinks
RewriteEngine on
RewriteBase /point/to/dir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(point/to/dir)/(.*)/?$ https://domain.ext/$1/module/status.php?id=$2 [NC,L,QSA]


OR in case you are in same domain name then you need not to mention complete url in right part of rewriting, have it then following way, make sure either use above or following rules one at a time only.

Options +FollowSymLinks
RewriteEngine on
RewriteBase /point/to/dir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(point/to/dir)/(.*)/?$ $1/module/status.php?id=$2 [NC,L,QSA]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!