mod rewrite permalinks htaccess header.php
-
working on a mod rewrite for url
https://nameofsite.com/?p=10
to read the title of the post in the url, example:
https://imcsites.com/name-of-post-title/name-of-post-titleI have done the following to establish this:
Login into wordpress and then options and then permalinkcustom field place this:/%category%/%postname%/
in .htacess file place this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>go to header.php and paste the following in the title:
<title>
<?php wp_title(‘ ‘); ?><?php if(wp_title(‘ ‘, false)) { echo ‘–’; } ?><?php
bloginfo(‘name’); ?>
</title>
My finished result does include the title in the url but the content like my side bar and headers disappear.
is there more that i need to include?
- The topic ‘mod rewrite permalinks htaccess header.php’ is closed to new replies.