Trouble With Permalink Structure ! (11 posts)

  1. Ali_ix
    Posted 12 years ago #

    hi all
    i have a problem !
    i have tried to have a permalink as this structure : /archives/%year%/%monthnum%/%day%/%post_id%/
    and did it and applied the .htaacces rules as WP said and all things goes OK !
    but all my images addreses goes Wrong and changed to permalink structure
    for example an image in /weblog/images/ali.gif goes to :
    /archives/2004/5/14/3/images/ali.gif ! :(
    and all the themplate messed up !
    how can i fix it ?!
    any change in .hta acces ?! or .. !?
    PLZ help me ! :(
    Tanx ...
    Ali ix

  2. Stevarino
    Posted 12 years ago #

    Can you show us the rules you entered into the htaccess file? The script that generates those rules is not perfect yet. :)

  3. Ali_ix
    Posted 12 years ago #

    yes !
    that is the rule :

    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&p=$4&page=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?year=$1&monthnum=$2&day=$3&p=$4&feed=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([0-9]+)/trackback/?$ /wp-trackback.php?year=$1&monthnum=$2&day=$3&p=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]

    Tanx 4 your support ...
    Ali ix

  4. Ali_ix
    Posted 12 years ago #


  5. Stevarino
    Posted 12 years ago #

    Thanks for the bump... I've been looking over this for the past few minutes and I'm stumped. :(
    You're saying an image whose src attribute set to /weblog/images/ali.gif is being redirected to /archives/2004/5/14/3/images/ali.gif?
    Hm... How do you know the image request is being sent to the archives URI (error logs, source views, etc)? And how is the template messed up?
    Right now I don't see how the .htaccess file is doing this, so I'm betting on another malfunctioning piece of code (perhaps a stray plugin or something similar...).

  6. Anonymous
    Posted 12 years ago #

    I use the base link as chiensavant suggests. I'd advise going with that. Just plug it in the head of your pages' xhtml. When using links and images, you have to type them in relation to your root directory.

  7. Ali_ix
    Posted 12 years ago #

    wooooooot !
    thanx Friend !
    all thing goes right with BASE URL !
    Tanx Alot chiensavant !
    Ali ix

  8. Anonymous
    Posted 11 years ago #

    Hrm Im having some trouble getting my blog to work with the base url thing. First of all the images work fine, but things under the comments like the time being linked to the post, and the arrow leading to the posting area all lead back to the main page. =\

  9. peter_k
    Posted 11 years ago #

    Hi, you can put this in your index.php or header.php file (depends where you have the <head ...> ... </head> stuff):

    $basehref = "http://".$_SERVER['SERVER_NAME'].($_SERVER['SCRIPT_NAME']);

    <base href="<?php echo"$basehref"; ?>">

    It works when your main index.php file is in the same directory as the entire wp install.

  10. acarboni
    Posted 10 years ago #

    Is there a way to make this work if your index.php is in a theme subdirectory?

  11. moshu
    Posted 10 years ago #

    In any WP install there are at least two (2) index.php files!
    There is one (the "short and sweet" in your WP root install, and every theme must have its own index.php template file.

    Edit. And this is a year old thread. What version are you using? Why not start your topic?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.