WordPress in a subfolder – mod_rewrite?
-
Hello everyone!
QUESTION BACKGROUND:
I’m trying to get wordpress working in a subfolder on a website. I want to thoroughly test it before it goes live. I don’t want to interfere with the currently running website.ACTIONS TAKEN:
I’ve created a new folder off root called wordpress, and thrown my wordpress files in here. I have logged into the General settings and changed the WordPress address (URL) and site address to http://www.mydomain.com/wordpress.Now when I go to preview, say the faq page, I see the url looks correct i.e. http://www.mydomain.com/wordpress/faq however it comes up with a 404.
Now after a quick bit of reading – i get the impression i can modify the .htaccess file and use mod_rewrite to funnel all requests to wherever i want.
I created a file called test.php which is a copy of index.php from the wordpress directory. (I called it test.php so it won’t interfere with the current live sites index.php).
QUESTION:
My thoughts on how to solve the situation is to use mod_rewrite to funnel all requests going to the /wordpress directory back to the test.php file.Does that sound about right?
If so how would I modify my mod_rewrite to do this? I only want requests going to http://www.mydomain.com/wordpress/xxxxx to be picked up and re-written.
My attempt so far. Do I need to add a condition of the wordpress folder somewhere?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^test\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test.php [L]
</IfModule>Many thanks!
The topic ‘WordPress in a subfolder – mod_rewrite?’ is closed to new replies.