Author Topic: Re: Hide "page" directory and "php" extension  (Read 3212 times)

daydreamer

  • Guest
Re: Hide "page" directory and "php" extension
« on: July 09, 2010, 04:05:29 PM »
@cosmorphis this works great for me thanks, how would I do the same for bakery aswell?
www.mydomainnameher e.com/pages/bakery/product

Thanks
« Last Edit: July 09, 2010, 04:08:20 PM by Argos »

daydreamer

  • Guest
Re: Hide "page" directory and "php" extension
« Reply #1 on: July 10, 2010, 07:58:49 PM »
 :? could anyone help with this please
Thanks

Offline kweitzel

  • WebsiteBaker Org e.V.
  • **
  • Posts: 6983
  • Gender: Male
Re: Hide "page" directory and "php" extension
« Reply #2 on: July 10, 2010, 08:18:32 PM »
I moved your request into the Bakery support area. You might want to try to explain a bit better though!

cheers

Klaus

daydreamer

  • Guest
Re: Hide "page" directory and "php" extension
« Reply #3 on: July 11, 2010, 12:02:51 PM »
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

Code: [Select]
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

 

postern-length