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

105
Views
.htaccess change wordpress hompage but keep the link

example.com/wp or example.com/wp/

<- This is what homepage link used to be like and I'm trying to keep it this way. But I want the server to serve some static page from another subfolder as a front page (but to keep all the other wp contents at the same places)

My static page (several of them tbh) are stored in root/subf1/

I was able to redirect to the desired subfolder, but the path also shows up in the URL. Is it possible to change example.com/subf1 to example/wp?

Here's my current htaccess. Maybe I need to create another one in a static page folder?

<IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteCond %{REQUEST_URI} !^/subf1/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ /test/page/$1
      RewriteCond %{HTTP_HOST} ^(www.)?example.com$
      RewriteRule ^(/)?$ /subf1/index.html [L] 
 </IfModule>

RedirectMatch "^/wp$" "https://example.com/subf1/"

Thank you a lot for your time

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

RedirectMatch does only "external redirections", so you probably want internal redirection with a RewriteRule (without the R flag).

So instead of RedirectMatch try:

RewriteRule ^wp$ https://example.com/subf1/ [L]

PS: Generally it is good to go for redirect/redirectmatch instead of going for mod_rewrite, but if you are already using mod_rewrite directives it will be less confusing to stick to it and not mix direcitves from one or the other.

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!