2
votes

mode rewrite is on (checked with info.php test AllowOveride All in etc/httpd/conf/httpd.conf file

inserted .htaccess in /var/www/html

RewriteEngine On
 RewriteBase /wordpress/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /wordpress/index.php [L]

( want to redirect from home page to wordpress subdirectory ...)

restarted Apache

service httpd restart

but Apache home page displayed ... on http://mywpblog.net

wordpress home page when request is http://mywpblog.net/wordpress

Did I miss anything ? ( dummy on EC2/httpd ) thanks

1
the root site mywpblog.net to the wordpress directory mywpblog.net/wordpress .. I re-tested w a modified .htaccess ( see my answer ) and it works ... - user762579

1 Answers

3
votes

wrong .htaccess ! should be ( in /var/www/html directory )

<IfModule mod_rewrite.c>

# Turn on rewrites.
 RewriteEngine on

# Don't apply to URLs that go to existing files or folders.
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

# Only apply to URLs that aren't already under /wp.
 RewriteCond %{REQUEST_URI} !^/wordpress/

# Rewrite all those to insert /wordpress
 RewriteRule ^(.*)$ /wordpress/$1

# Redirect the root folder.
 RewriteCond %{HTTP_HOST} ^(www.)?yodojodo.net$
 RewriteRule ^(/)?$ wordpress/ [L]
 </IfModule>