Title: Trouble With Permalink Structure !
Last modified: August 18, 2016

---

# Trouble With Permalink Structure !

 *  [ali_ix](https://wordpress.org/support/users/ali_ix/)
 * (@ali_ix)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/)
 * 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

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [stevarino](https://wordpress.org/support/users/stevarino/)
 * (@stevarino)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-73633)
 * Can you show us the rules you entered into the htaccess file? The script that
   generates those rules is not perfect yet. 🙂
 *  Thread Starter [ali_ix](https://wordpress.org/support/users/ali_ix/)
 * (@ali_ix)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-73685)
 * 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
 *  Thread Starter [ali_ix](https://wordpress.org/support/users/ali_ix/)
 * (@ali_ix)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-73815)
 * ?
 *  [stevarino](https://wordpress.org/support/users/stevarino/)
 * (@stevarino)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-73819)
 * 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…).
 *  Anonymous
 * [21 years, 10 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74226)
 * 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.
 *  Thread Starter [ali_ix](https://wordpress.org/support/users/ali_ix/)
 * (@ali_ix)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74271)
 * wooooooot !
    thanx Friend ! all thing goes right with BASE URL ! Tanx Alot chiensavant!
   Ali ix
 *  Anonymous
 * [21 years, 9 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74362)
 * 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. =\
 *  [peter_k](https://wordpress.org/support/users/peter_k/)
 * (@peter_k)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74440)
 * Hi, you can put this in your index.php or header.php file (depends where you 
   have the <head …> … </head> stuff):
 * `<?php
    $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.
 *  [acarboni](https://wordpress.org/support/users/acarboni/)
 * (@acarboni)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74470)
 * Is there a way to make this work if your index.php is in a theme subdirectory?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74471)
 * 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?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Trouble With Permalink Structure !’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 6 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/trouble-with-permalink-structure/#post-74471)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
