WordPress Page Permalink and .htaccess
-
Hello!
I am wondering if it’s possible to eliminate wordpress writing to .htaccess everytime a new Page is created.
With Permalinks enabled, wordpress will create entries like these in the .htaccess everytime a new page is created.
example:
RewriteRule ^(page_slug)/trackback/?$ /index.php?pagename=$1&tb=1 [QSA,L]
RewriteRule ^(page_slug)/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(page_slug)/(feed|rdf|rss|rss2|atom)/?$ /index.php?pagename=$1&feed=$2 [QSA,L]
RewriteRule ^(page_slug)/page/?([0-9]{1,})/?$ /index.php?pagename=$1&paged=$2 [QSA,L]
RewriteRule ^(page_slug)(/[0-9]+)?/?$ /index.php?pagename=$1&page=$2 [QSA,L]For each new page created, wordpress will create 5 rewrite rules. so if you have 100 pages then you’ll get 500 rewrite rules in your .htaccess file.
My current site structure are the following:
example.com/category/post-slug/
example.com/page-slug/The Posts work great for me and I like it, but I would like to have the Page structure like this
example.com/page/page-slug/ (so only one set of rewrite rules are needed for Pages) instead of this example.com/page-slug/Does anyone know how to solve this without letting wordpress create additional RewriteRules?
Thank you very much;)
- The topic ‘WordPress Page Permalink and .htaccess’ is closed to new replies.