• Resolved robsbots

    (@robsbots)


    Hi all.

    I am about to launch a new site. I would like to the site to use pretty permalinks such as http://www.healthandbooty.co.uk/products/ rather than the standard http://www.healthandbooty.co.uk/?page_id=33

    As yet the site has not been launched and there are a total of only 6 pages.

    I have tried changing the permalink settings in wordpress but this gives me 404 errors.

    My htaccess file on the server is as follows with the postnames permalink setting :-
    #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

    I am not worried about loosing traffic as the site is new and currently has no traffic. I would like o get it set up so when the site goes live I get the pretty SEO freindly links.

    Later I may well add blogging and posts, but currenty it is just pages.

    Thanks.

    btw. I’m not a bot, I just have and interest in robotics, hence the user name 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    -Try resetting your custom permalinks back to the default setting and renaming your WordPress .htaccess file. If that works, then try reading Using_Permalinks before setting a custom permalink structure again.

    If clearing your Permalinks does not alleviate the issue, this could be attributed to anything from a web server configuration to a bad WordPress install.

    Thread Starter robsbots

    (@robsbots)

    Thanks for the reply Tara.

    I now have it working. It turned out to be a mis configured server. Now that is cleared up I’m running with pretty links.

    Thanks again for your help.

    Rob.

    Moderator t-p

    (@t-p)

    You are welcome 🙂

    Thread Starter robsbots

    (@robsbots)

    To enable pretty permalinks there are a few steps.

    I am running apache2 on a linux OS so the following is for that setup.

    Step 1. Enable mod-rewrite on the server.
    From the ssh prompt on your server type :-
    a2enmod rewrite
    This enables the mod-rewrite plugin on the server.

    Step 2. Set up your site to use modrewrite.
    Edit the virtual hosts file for your site.
    What follows is the config for my site with the added declerations to enable mod-rewrite.

    <VirtualHost *:80>
        ServerAdmin webmaster@mydomain.com
        ServerName www.mydomain.com
    
        RewriteEngine On
        RewriteOptions Inherit
        DocumentRoot /var/www/mydomain/wordpress
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        </Directory>
        <Directory /var/www/mydomain/wordpress/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride FileInfo
            Order allow,deny
            allow from all
        </Directory>
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

    Take special note of the RewriteEngine On, RewriteOptions Inherit, AlowOverride, and allow directives.

    Step 3.
    Once these are all set you may need to restart your server.
    At the ssh command line enter :-
    service apache2 restart

    Step 4.
    Your should now be able to use the permalink settings in wordpress.

    Hope this helps someone out.

    Thanks.

    Rob.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Permalinks problems’ is closed to new replies.