This is my third question about htaccess. I should’ve made one single. But I thought this would be too big of a question.
This is used for my own CMS. :o)
My htaccess is:
RewriteEngine on
RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]
Remove index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
And what I would like to do is:
Remove /page/ from my URL, and just have for example: myurl.com/home
Right now my urls are: http://www.myurl.com/page/home or whatever title is given. Now, when people create new pages in the CMS, they maybe wan’t a page called: About us.
And what this will en up being is:
http://www.myurl.com/page/about%20us
How do I add “-” instead of %20?
You can easy remove
page/from the .htaccess, but you have to ignore existing files and directories:Your second problem has nothing to do with .htaccess. You have to link the page
About usas/about-us/instead of/about%20us/(%20represents a space), and if the page/about-us/(index.php?page=about-us) is called just handle it as/about%20us/. So simply replace spaces with-.