Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

htaccess in root and subdirectory

$
0
0

Replies: 1

I have read lots of helpful information about this, but am still unclear on some matters.

WordPress has been installed in its own directory /wordpress and the website address was originally test.pat.gen.nz/wordpress

/wordpress/index.php includes statement:
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );

I use pretty permalinks, so /wordpress/.htaccess comprises:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

In order to change the url of my website to test.pat.gen.nz (leaving WordPress in its subdirectory), I copied (not moved) the above two files to the root, modifying them as follows:

index.php:
require( dirname( __FILE__ ) . ‘/wordpress/wp-blog-header.php’ );

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

It all works as expected, so I am probably worrying over nothing, but I just want to be sure that I am correct in leaving the two files in /wordpress.

As an aside, I understand that htaccess intercepts a call to test.pat.gen.nz/map and routes the request to test.pat.gen.nz/index.php. How does WordPress know that the intended page was ‘map’? Again, I probably do not delve too deeply into things which work perfectly well!

Regards
Andy


Viewing all articles
Browse latest Browse all 59525

Trending Articles