• Hi, I’m redesigning my site to use wordpress and have coded up a basic image gallery and use a page template for it’s base page.

    I have a very strange problem because things worked fine last week, then I went back to work on the site this week and things don’t work so well. There is something fishy with the redirects. So I have a page template called galleries and it can display images in a directory structure. So in the top level directory I have dirs such as

    2004
    2004-Special_Event
    2003

    These may have subdirs like
    2004/12-10-07–A_Day_of_Wallowing_in_the_Muck

    etc. So you can request a thumbnail gallery of a directory with

    /wp/galleries/2004
    or
    /wp/galleries/2004-Special_Event
    or
    /wp/galleries/2004/12-10-07–A_Day_of_Wallowing_in_the_Muck

    You get the idea. Now here’s the weird bit.
    /wp/galleries/2004
    works properly…it redirects to
    /wp/index.php?pagename=galleries$page=2004

    BUT the other ones won’t work. It seems like any variable with the — or _ just redirects to a 404 page. But like I said, this was working last week. The .htaccess was created automatically by wordpress and I had it recreate it but to no avail.

    Any ideas???

    Here’s the appropriate section from my .htaccess:
    *****************************************************
    RewriteRule ^(galleries)/trackback/?$ /wp/index.php?pagename=$1&tb=1 [QSA,L]
    RewriteRule ^(galleries)/feed/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
    RewriteRule ^(galleries)/(feed|rdf|rss|rss2|atom)/?$ /wp/index.php?pagename=$1&feed=$2 [QSA,L]
    RewriteRule ^(galleries)/page/?([0-9]{1,})/?$ /wp/index.php?pagename=$1&paged=$2 [QSA,L]
    RewriteRule ^(galleries)(/[0-9]+)?/?$ /wp/index.php?pagename=$1&page=$2 [QSA,L]
    ****************************************************

Viewing 1 replies (of 1 total)
  • Thread Starter master_kato

    (@master_kato)

    Ok, so it looks obvious that the problem is that the rewrite rules don’t allow for dashes or underscores I guess….but posts are allowed to have dashes. Why wouldn’t WordPress allow the rewrite rules process any normally valid path?

Viewing 1 replies (of 1 total)
  • The topic ‘Permalinks not working on some pages’ is closed to new replies.