WordPress.org

Ready to get started?Download WordPress

Forums

Permalink and Website Intergration - loop no longer working (19 posts)

  1. Damien15
    Member
    Posted 1 year ago #

    If i set Permalink to anything other than default it stops my PHP website intergrations from working.

    On the php pages on my site I ahve used the LOOP system to display content from a set catagory.

    Is there away I can still use this and have Permalink to something more freindly than a number.

    Thanks

    Damien

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Check with your hosts that mod_rewrite is running on your server and that your WordPress root .htaccess file is being updated correctly.

  3. santoshelp
    Member
    Posted 1 year ago #

    I'm having the same problem, I already checked the .htaccess file and I manage to make the site working but the admin only works if i delete the .htaccess file, when I do it the pages can't be found. Could anyone tell me a way to fix it and make sure both works,

    Thanks

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    @santoshelp: It is impolite to interrupt another poster's ongoing thread with a question of your own and it causes significant problems for the forum's volunteers. Please post your own topic.

  5. Damien15
    Member
    Posted 1 year ago #

    Hi thanks for you advice esmi, mod_rewrite is working on the server as far as I can see the htaccess file is updating. Not sure if I explained the problem correctly.

    Our main website is http://www.plymouthcathsoc.org.uk and our blog is located at http://www.plymouthcathsoc.org.uk/blog/

    Our news and events pages pull articles directly from the blog. On the blog there a category for news and a category for events (plus others.
    our news page can be found here http://www.plymouthcathsoc.org.uk/news.php

    The news page incude any article that is found in the news category (category 3) if Permalink is running on the default settings the url for the category is as follows http://www.plymouthcathsoc.org.uk/blog/?cat=3 however if i set permalink to say http://www.plymouthcathsoc.org.uk/blog/news/ the pagesz then tell me there no posts matching my criteria

    The code I am using on the php pages is as follows

    <?php query_posts($query_string . '&cat=3'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     <div class="post">
    
     <!-- Display the Title as a link to the Post's permalink. -->
     <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
    
     <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
     <small>Posted <?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
    
      <div class="entry">
        <?php the_content(); ?>
      </div>
    	 <hr></hr>
    <p></p>
     </div> <!-- closes the first div box -->
    
     <?php endwhile; else: ?>
     <p>Sorry, no posts matched your criteria.</p>
     <?php endif; ?>

    If I turn on permalinks and set it to use something other than default do I need to change this line of code

    <?php query_posts($query_string . '&cat=3'); ?>

    Thanks
    Damien

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You shouldn't have to change a query because of a change in permalinks. WordPress handles all of that internally. Is there an .htaccess file in your root domain folder? If so, what's in that?

  7. Damien15
    Member
    Posted 1 year ago #

    HI I am running my hosting on cpanel.

    I have my main domain http://www.damiensplace.co.uk

    then I have added my other domains such as http://www.plymouthcathsoc.org.uk which is running on a subdomain.

    My main site for plymouthcathsoc.org.uk is found in the root of this "sub-domain" there is the a folder for all the blog pages, /blog/
    Mainsite - http://www.plymouthcathsoc.org.uk
    |
    *-blog Folder - http://www.plymouthcathsoc.org.uk/blog/

  8. Damien15
    Member
    Posted 1 year ago #

    .htaccess in the main domains http://www.damiensplace.co.uk

    RewriteOptions inherit
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^adultdyslexiahelp\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.adultdyslexiahelp\.co\.uk$
    RewriteRule ^/?$ "http\:\/\/www\.atozdyslexiasolutions\.co\.uk" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^sherwellstudentgroup\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.sherwellstudentgroup\.co\.uk$
    RewriteRule ^/?$ "http\:\/\/www\.plymouthcathsoc\.org\.uk" [R=301,L]
    
    Options -Indexes
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  9. Damien15
    Member
    Posted 1 year ago #

    .htaccess in main domain http://www.damiensplace.co.uk

    RewriteOptions inherit
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^adultdyslexiahelp\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.adultdyslexiahelp\.co\.uk$
    RewriteRule ^/?$ "http\:\/\/www\.atozdyslexiasolutions\.co\.uk" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^sherwellstudentgroup\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.sherwellstudentgroup\.co\.uk$
    RewriteRule ^/?$ "http\:\/\/www\.plymouthcathsoc\.org\.uk" [R=301,L]
    
    Options -Indexes
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    the .htaccess for the main website for the blog http://www.plymouthcathsoc.org.uk

    RewriteOptions inherit

    .htaccess for the blog at http://www.plymouthcathsoc.org.uk/blog/

    RewriteOptions inherit
    
    # BEGIN WordPress
    
    # END WordPress
  10. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Is this a multisite install?

  11. Damien15
    Member
    Posted 1 year ago #

    no, least don't think so

    http://www.damiensplace.co.uk is the main domain on the account wordpress is running on there but tis got its own files and it own data base

    http://www.plymouthcathsoc.org.uk is perdomantly a html site, with only pages need to be interactive witen in php. it all hard coded exceot for the above code when it pulls articles from the blog

    http://www.plymouthcathsoc.org.uk/blog/ has its own worpress files and database

    the two blogs should not be sharing anything though they do have the same apps installed on each

    6thanks

    damien

  12. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    What permalink structure are you using on http://www.plymouthcathsoc.org.uk/blog/

  13. Damien15
    Member
    Posted 1 year ago #

    none, if I use any then the querry code on the main plymouthcathsoc.org.uk website stops working

  14. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Can you remove the .htaccess file on the main plymouthcathsoc.org.uk website?

  15. Damien15
    Member
    Posted 1 year ago #

    Hi I have removed it from the plymouth cathsoc site, then went at set my permalink to postname and check to see if the querry was working and it was not, back to saying no post to disaply

  16. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Was the .htaccess file on blog updated correctly?

  17. Damien15
    Member
    Posted 1 year ago #

    here is the .htaccess with peralinks set to none

    RewriteOptions inherit
    
    # BEGIN WordPress
    
    # END WordPress

    here is .htaccess with permalink set to postname

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

    thanks

    Damien

  18. Damien15
    Member
    Posted 1 year ago #

    might be misunderstanding this but can't see why .htaccess would stop php file pull info from another source

  19. Damien15
    Member
    Posted 1 year ago #

    can anyone help?

Topic Closed

This topic has been closed to new replies.

About this Topic