search engine friendly urls

Soldato
Joined
18 Oct 2002
Posts
7,614
Location
Sutton Coldfield, Birmingham
I'm trying to get my head around this but can't

I've read numerous articles and tried different .htaccess things but for some reason it just doesn't seem to work, yet wordpress works fine so I know it's not my host.

I'm trying to do a similar thing to wordpress so that blog post headers and property addresses are in the url and page title.

The website format is as follows

index.php
- blog.php
-- blog.php?blogid=121
- forsale.php
-- forsale.php?propid=321

etc

all I want is to remove .php from the page urls and to change

blog.php?blogid=121

into

blog/title-of-blog-here/

Any pointers?
 
Soldato
OP
Joined
18 Oct 2002
Posts
7,614
Location
Sutton Coldfield, Birmingham
Right using this one

http://stackoverflow.com/questions/16388959/url-rewriting-with-php (second answer down with 11)

The home page works (inc/home.php) however when trying to use "/page/blog" or "/page/contact" it comes up with

PHP:
Warning: include(/var/sites/s/steve-morris1.co.uk/public_html/new/inc/page.php): failed to open stream: No such file or directory in /var/sites/s/steve-morris1.co.uk/public_html/new/index.php on line 126

Warning: include(): Failed opening '/var/sites/s/steve-morris1.co.uk/public_html/new/inc/page.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/sites/s/steve-morris1.co.uk/public_html/new/index.php on line 126

And I cant seem to find out why

My array is

PHP:
$rules = array( 
    'picture'   => "/picture/(?'text'[^/]+)/(?'id'\d+)",    // '/picture/some-text/51'
    'album'     => "/album/(?'album'[\w\-]+)",              // '/album/album-slug'
    'category'  => "/category/(?'category'[\w\-]+)",        // '/category/category-slug'
    'page'      => "/page/(?'page'blog)",     // '/page/about', '/page/contact'
    'post'      => "/(?'post'[\w\-]+)",                     // '/post-slug'
    'home'      => "/"                                      // '/'
);
 
Last edited:
Back
Top Bottom