216 questions

223 answers

12 comments

334 users

Welcome to OSSbible, where you can ask Open Source Products questions and receive answers from members of the community. OSSbible has very active & vibrant community members whose knowledge is unparalleled.

How to enable mod_rewrite for wordpress application with nginx/apache2.

0 votes
asked Dec 1, 2015 in Linux by Stuart (510 points)

1 Answer

+1 vote
 
Best answer
For nginx we need to add nginx default file

rewrite ^/blog/(.*)/(.*\.php)(/)(.*)$ /blog/$1/$2?file=/$4 last;

rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;

For apache we can by creating .htaccess file

DocumentRoot /usr/share/nginx/html

Options -Indexes IncludesNOEXEC FollowSymLinks -MultiViews

AllowOverride All

Order allow,deny

Allow from all

RewriteEngine On

RewriteRule ^(.*)$ /index.php$1?%{QUERY_STRING}
answered Dec 1, 2015 by prithvi (2,660 points)
selected Dec 1, 2015 by Stuart

Related questions

+2 votes
1 answer
+1 vote
1 answer
+1 vote
0 answers
+1 vote
1 answer
asked Dec 1, 2015 in Linux by prithvi (2,660 points)
...