Andi
Andi

Reputation: 305

Htaccess issue with installing php script in WordPress directory

My root directory has a wordpress install in it. I added a folder called 'jobs' and put a php script in it. When I access mysite.com/jobs, it works.. but when I drill down below that, such as trying to access mysite.com/jobs/parttime/miami -- that's when it defaults to the wordpress 404 page.

I've been searching for the right answer here, but can't seem to make anything work.

.htaccess

 # BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteRule ^jobs - [L] 
RewriteEngine On 
RewriteBase / 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress

Upvotes: 0

Views: 340

Answers (1)

Peter O&#39;Callaghan
Peter O&#39;Callaghan

Reputation: 6186

There are lots of different ways to go around solving this. An alternative would be add a RewriteCond to the main WordPress redirect, so that it skips requests beginning with jobs.

 # BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?jobs
RewriteRule . /index.php [L] 
</IfModule> 
# END WordPress

Upvotes: 2

Related Questions