0
Welcome Guest! Login
0 items Join Now

SOLVED : URL Rewriting + .htaccess

    • fabb's Avatar
    • fabb
    • Jr. Rocketeer
    • Posts: 28
    • Thanks: 0

    SOLVED : URL Rewriting + .htaccess

    Posted 13 years 4 months ago
    • Hello,
      I am working on making my URLs cleaner. I have Joomla 1.7.3 site currently showing the following URL format (ignore the space):
      http ://mysite.com/index.php/2011-12-25-15-24-15/business-law

      I hope for it show: http ://mysite.com/business-law

      My install is in root. I have both htaccess.txt and .htaccess that came with the install. The only entry in .htaccess is the line: Options -Indexes

      Do I copy this line over to htaccess.txt, delete .htaccess and then rename htaccess.txt to .htaccess?
      After which, I know I have to enable "Use URL Rewriting" in Global Configuration/SEO Settings.

      Do I then uncomment # RewriteBase /?

      What do I do with the following line:
      # internally rewrite the request to the index.php script
      RewriteRule .* index.php [L]


      How soon do the changes generally take effect?

      Thank you in advance for your expertise on this!
    • Last Edit: 13 years 4 months ago by fabb.
    • fabb's Avatar
    • fabb
    • Jr. Rocketeer
    • Posts: 28
    • Thanks: 0

    Re: SOLVED : URL Rewriting + .htaccess

    Posted 13 years 4 months ago
    • I just want to share how I solved this.

      Yes on all of the above regarding .htaccess

      Just assign an alias to the parent menu item so that the child items' URLs do not default to include the timestamp of the parent. My URLs now look like this:

      http: //mysite.com/practice/business-law
  • Re: SOLVED : URL Rewriting + .htaccess

    Posted 13 years 3 months ago
    • Just a suggestion for SEO purposes. Add the following to your htaccess file to prevent duplicate content issues and direct all link juice to a single version of any particular page:

      ## Begin - Custom redirects
      #Add trailing slash
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{HTTP_HOST} !^(www\.)?yoursite\.com/$ [NC]
      RewriteCond %{REQUEST_URI} !(.*)/$
      RewriteRule ^(.*)$ www.yoursite.com/$1/ [R=301,L]
      #Redirect non-www to www
      RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
      RewriteRule ^(.*)$ www.yoursite.com/$1 [R=301,L]
      ## End - Custom redirects
    • Do wacha gotta do to get to where you wanna be.

Time to create page: 0.076 seconds