• I just installed wordpress for the first time and noticed the .htaccess file has two comments in it and then I chose numeric permalinks with /archives/4, etc. etc. Well, when I use the page, I get a 404, but I notice the link on the main page to the other pages is wrong…it is not numeric at all but is rather /wordpress/proj-mgmt-blog like that which is cool and all, but then I get a 404 on that. The .htaccess file it generated was so….(Can I modify the .htaccess file to make this work???…not sure why it is not obeying the numeric at all, is this a bug?)

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase wordpress/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>

    # END WordPress

Viewing 12 replies - 1 through 12 (of 12 total)
  • you must use a correct permalink structure
    https://codex.www.ads-software.com/Using_Permalinks#Choosing_your_permalink_structure

    note – you do not input archives in permalinks

    Thread Starter deanhiller

    (@deanhiller)

    All I did was click the numeric radio button though. I did not use any custom format or anything and wordpress was the one that put the word archives in there, not me….What does it say in custom field when you click the numeric radio button field? Maybe I should define my own customer format? I just thought it would be easier to choose numeric and be done with it…..but that didn’t seem to work.

    Thread Starter deanhiller

    (@deanhiller)

    NOTE: notice on the link you gave me, numeric radio button also has the url ……/archives/123 as well….Are you saying that radio button can’t be used?

    yes radio buttons should work – I thought you were using a custom structure

    try deleting the .htaccess and re-saving the permalinks as advised above

    note – you’re not on a windows server are you?

    Thread Starter deanhiller

    (@deanhiller)

    I am on a linux Amazon ubuntu image and I reset it back to the first choice, checked out the new .htaccess file it generated and it was emptied it out and then I clicked numeric choice and it filled it in with the contents I showed you above. If you click numeric radio button and save, what are the contents of your .htaccess file?????(I assume we should end up with the same exact contents)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    # END WordPress

    Try that. Your rewrite base looked a little off.

    Thread Starter deanhiller

    (@deanhiller)

    hmmm, I was fooling around with the RewriteBase based on some other post since it did not work out of the box. What version of wordpress did you generate that from??(ie. maybe tonight I will just switch versions as the latest version didn’t seem to work for me).

    I will try again tonight and regen the file from wordpress first but I think it will match that(I think I copied after editing the file on accident when it didn’t work).

    thanks,
    Dean

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    3.2.1 – though the code’s not changed for SingleSite in … well not for 7 years

    There is only ONE difference in what you had and what I suggested.

    Yours had this : RewriteBase wordpress/

    Mine has this: RewriteBase /wordpress/

    See the diff? ??

    Thread Starter deanhiller

    (@deanhiller)

    Well, I tried that, also wiped my database clean as well by dropping all tables. I then went through the web install page again and chose the radio button for numeric and it generated the .htaccess file just fine but the links are still all wrong. Instead of /wordpress/archives/<some number>, the links for some reason are /wordpress/sample-page

    ?? I have no idea what could be wrong since this is a very clean install and choose numeric radio button. The link is https://blog.alvazan.com/wordpress …..it is just so weird.

    Thread Starter deanhiller

    (@deanhiller)

    more info. I tried changing between all of the radio buttons and the .htaccess file it generates the same. MORE IMPORTANTLY though is that I can remove the .htaccess file, refresh the page and the link does not change….somehow selecting a radio button changes the urls in the php pages and so the rewrite does not work at all????

    Thread Starter deanhiller

    (@deanhiller)

    SOLVED (kind of). You must be using a different version of apache or something. I had a friend help me so now when I select numeric, it does all the links as the page names with dashes like sample-test-page, etc. but the links work now!!!! yeah!!!

    The change was in /etc/apache2/sites-enabled/000-default
    he changed
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    </Directory>
    to
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews +Includes
    AllowOverride All
    Order allow,deny
    allow from all
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    </Directory>

    so it seems like wordpress is not working as expected with apache2 maybe? not sure but it works now for me albeit not doing the numeric method even though that is what I selected.

    Hi!

    I am using a child theme for Thematic. I am using the custom permalink setting /%year%/%monthnum%/%postname%/. For some reason, when you scroll down and click “older posts” I get a 404 page.

    I am using 1and1 and my mod_rewrite is on, I don’t know why this is happening.

    I’ve tried-

    deleting my htcassess, disabling all my plugins, changing the custom permalink settings to include %post_id%, every single plugin that exists, changing my reading settings.

    do i have to change it to match my reading settings which are 5 posts per page?

    the code in my blog template is

    <?php
    $wp_query = new WP_Query();
    $wp_query->query( array( ‘posts_per_page’ => get_option( ‘posts_per_page’ ), ‘paged’ => $paged ) );
    $more = 0;
    ?>

    please help!! I’d be so thankful!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘permalink wrote my .htaccess wrong or???’ is closed to new replies.