Re: Hide "page" directory and "php" extension

daydreamer

I'm using a mod_rewrite which removes the pages directory

Instead of : www.mydomain.com/pages/page.php
Outputs: www.mydomain.com/page

I am also using backery but cant seem to remove /pages/backery/productname.php here is the rewrite rule if anyone could help

RewriteEngine on

#If 404 Not Found error, go to homepage
ErrorDocument 404 /index.php

RewriteEngine on

#If URL received with trailing slash (e.g. http://domain/test/) then go to correct page (e.g. http://domain/pages/test.php)
RewriteRule ^([^.]+)/$ pages/$1.php

#If URL received WITHOUT trailing slash (e.g. http://domain/test) then go to correct page (e.g. http://domain/pages/test.php)
RewriteRule ^([^.]+)$ pages/$1.php

#When user types in http://domain/admin or http://domain/admin/, it looks for http://domain/pages/admin.php, which doesn't exist, because of the previous rules. This corrects that.
RewriteRule pages/admin.php admin/index.php

kweitzel

I moved your request into the Bakery support area. You might want to try to explain a bit better though!

cheers

Klaus

daydreamer

 :? could anyone help with this please
Thanks

daydreamer

#1
@cosmorphis this works great for me thanks, how would I do the same for bakery aswell?
www.mydomainnamehere.com/pages/bakery/product

Thanks