PHP and Wordpress rewrite (.htaccess) - is it possible?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Mon Sep 02, 2013 5:14 am

PHP and Wordpress rewrite (.htaccess) - is it possible?

Postby andrewbiz » Mon Sep 02, 2013 1:35 pm

Hi everyone,

I have the following .HTACCESS which is used for my PHP files. However I want to keep all the following information (see second .HTACCESS) but change the address of my wordpress files from to

If I follow the tutorial and add the following to my .HTACCESS it works...

Code: Select all

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

# END WordPress

... However none of my other rewrites work... any ideas? My original .HTACCESS file is below;

Code: Select all

RewriteEngine on

# defeat robot exploits
RewriteCond %{QUERY_STRING} http:// [OR]
RewriteCond %{REQUEST_URI} http://
RewriteRule ^(.*)$ - [F]

rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

# disable directory browsing
Options All -Indexes

RewriteRule ^furniture(.*).html$ furnituredisplay.php?page=furniture/furniture$1&type=htm [L,NC]
RewriteRule ^android(.*).html$ androiddisplay.php?page=android/android$1&type=htm [L,NC]
#php_flag register_globals on
#php_flag display_errors off

Any ideas how to merge? If possible?


php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: PHP and Wordpress rewrite (.htaccess) - is it possible?

Postby johnj » Tue Sep 03, 2013 7:24 pm

your new rule is based on a condition. So, just place it as a block before the old rewrite rules and it should work.

Return to “PHP coding => General”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 3 guests