Forum Moderators: phranque
I have permalinks turned on in the form of example.com/postname/
My .htaccess file by default is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
If I go to
example.com/it
I get an italian translation of my page through the global translator plugin.
I would like if I could get example.com to show the example.com/it page by default and any attempt to go to example.com/postname would actually display example.com/it/postname.
At the same time I would like to still be able to access example.com/wp-admin for obvious reasons.
I have searched on google for hours and tried different methods, but did not end up with anything more useful than a 404 or 500 error page :) If anyone could give me some help it would be much appreciated for a mod_rewrite noob such as myself!
Thank you!
# BEGIN WordPress
<IfModule mod_rewrite.c>
# Turn on rewrites.
RewriteEngine on
# Base
RewriteBase /
Options +FollowSymLinks
# handle domain root and skip subfolders
RewriteCond %{HTTP_HOST} example.com
RewriteCond %{REQUEST_URI} !^/it/
RewriteCond %{REQUEST_URI} \..+$
RewriteRule ^(.*)$ it/$1 [L]
# add trailing slash to subfolders (eg abc to: abc/)
RewriteCond %{HTTP_HOST} example.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} [^/]$
RewriteRule ^(.*)$ $1/ [L,R=301]
# handle files in subfolders
RewriteCond %{HTTP_HOST} example.com
RewriteCond %{REQUEST_URI} !^/it/
RewriteRule ^(.*)$ it/$1 [L]
</IfModule>
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#</IfModule>
# END WordPress
Jim
attempt to go to example.com/postname would actually display example.com/it/postname.
if WP is using AcceptPathInfoIf WP would use path_info (i.e. /foo needs to be rewritten to /index.php/foo, otherwise path_info is empty), WP won't work if php runs via a CGI wrapper.