[resolved] Anything like Drupal's Path module to rename URLs? (10 posts)

  1. tmallen
    Posted 7 years ago #

    For example, "?page_id=3" isn't descriptive enough. Drupal has the Path module that allows simple path renaming, which would be more than enough for my development purposes. Something like Pathauto would be nice too, but I don't care to spend my time setting it up.

  2. Jeremy Clark
    Posted 7 years ago #

    There called permalinks and here are the docs on them.

  3. tmallen
    Posted 7 years ago #

    This looks promising, but didn't work for me. I tried pasting the generated rewrite rules into my .htaccess, and even did a chmod 777 to the file and re-set the permalink option (which successfully wrote to the file) but still no luck. And mod_rewrite is available and enabled on my local server. The paths in the Apache rules that WordPress generated seem correct too, and fiddling with them didn't work.

  4. What were the rules it generated?

    I assure you, Permalinks do work. The generated rules should always be the same, and depend mostly on the location of your blog directory. There's no need to "fiddle" with them.

    The WordPress rules simply point the rewrite engine to the index.php file. WordPress handles the URL rewrites internally.

  5. tmallen
    Posted 7 years ago #

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

    I've replaced the actual site root directory with "Sitename" for this contractor's privacy. Also, this is running over localhost, if that's of any importance.

  6. Well, that's correct, and that should pretty much be that.

    What are you getting on the site itself? What is the generated URL for, say, a single page? What are your Permalink settings set to? What happens instead of getting the page you're expecting?

    Basically, what is "not working" about it?

  7. tmallen
    Posted 7 years ago #

    These are set to:

    Date and name based
    ยป http://localhost/Sitename/2008/03/25/sample-post/

    If I try to go to the about page (which is where ?page=4 redirects) I get this Apache error:

    Not Found
    The requested URL /Sitename/about/ was not found on this server.

    I've gone to my httpd.conf and enabled mod_rewrite system-wide, but no change. I also tried removing the check:
    <IfModule mod_rewrite.c>...</IfModule>
    but without success. And mod_rewrite.so is definitely installed...

  8. tmallen
    Posted 7 years ago #

    Update: I ran the same script on my remote server and everything is working fine there. I guess my local server is jacked up.

  9. tmallen
    Posted 7 years ago #

    Apparently, mod_rewrite is loaded (according to $ apache2ctl -M) but I tested Drupal locally, and it too isn't recognizing the module. I guess I have work to do!

  10. tmallen
    Posted 7 years ago #

    Problem fixed. I had overly restrictive settings in my httpd.conf for AllowOverride, because I forgot to edit that setting when I last isntalled Apache2.

Topic Closed

This topic has been closed to new replies.

About this Topic