Hi, I am trying to make static pages in wordpress for example i want to make a page www.mysite.com/about.html For this i created a page with title About and i tried to change the permalink of the page to about.html but they don't accept a dot..So is there any way in which i can create a page using the WP's page creator and add .html to the end of the pages permalink..( i don't want to upload any html pages and do the job) (i hope this is the right section for this question as it is related to mod_rewrite.. if it is not, mods please do move it..)
i got that corrected using a wordpress plugin http://txfx.net/files/wordpress/periods-in-titles.phps now i still have another problem.. i have a file named news.php on my server. I want this page to be shown when somebody types in news.html(i am not looking for a redirect..).When user types in news.html the contents of news.php should be shown.. is that possible??? (To Mods: Couldn't edit the previous post)
yes you can without redirect, use mod_rewrite for it too Use this on your .htaccess file: RewriteEngine on RewriteBase / RewriteRule ^news\.html$ /news\.php Code (markup): now if someone will enter news.html in url, it will display content of news.php Thanks
thanks for the reply.i already have wordpress on my server's root folder and the present .htaccess file is # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Code (markup): So how should i edit this for the same..
just write this at the end of .htaccess : RewriteEngine On RewriteRule ^news\.php$ news\.html Note : news.html must exist
thanks i hope you meant the reverse.. My new htaccess is # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteEngine On RewriteRule ^latest\.html$ /latest\.php Code (markup): But when i goto sherlynchopra.org/latest.html it does not show the same thing as when we goto sherlynchopra.org/latest.php
okay try this one : <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^latest.html$ latest.php </IfModule> so that, your file looks like : <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^latest.html$ latest.php </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> it works perfectly, tested it myself on my own wordpress http://www.pegor.com/latest.html --> http://www.pegor.com/latest.php
Thanks a lot but still it has some problem...not working.. i used exactly the same thing in the .htaccess file according to your updated post.. but it shows a page not found... My htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^latest.html$ latest.php </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Code (markup): but still i have some problems.. sherlynchopra.org/latest.html doesn't show the same thing as sherlynchopra.org/latest.php
hmm.. but it is working with me wordpress you can see my example bro.. can you give me temporary access to your wordpress directory ? I will try some changes in htacess and see if it works..
your details arent working says file or folder not found, cannot connect Updated : Done, You didnt use my coded htaccess, you added a forward slash before the latest.php but its fixed now, and I am glad that it is working just the way you wanted it to work
thanks a lot.. Reps added.. it worked fine when i used a normal text file as latest.php but when i use an original php file( in this case i used wordpress's index.php file as latest.php) Now latest.php shows the latest wordpress posts(same as index.php shows) but latest.html shows a wordpress 404 page