简体   繁体   中英

htaccess wordpress/index.php rewrite rule

I have put my wordpress files inside a folder wordpress instead of root. I am able to access my site as www.example.com/wordpress But i want to access it as www.example.com, want to hide wordpress in url. my .htaccess file is as

<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>

How can i do this?

Try this:

Add this to the .htaccess in your root directory :

Options FollowSymLinks
RewriteEngine On

RewriteRule (.*) wordpress/($1) [NC,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM