Jump to content

[SOLVED] Quick question, add Slash in the end


mendoz

Recommended Posts

Konichiwa freaks

 

Here is my .htaccess

 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /guitar/

RewriteRule ^catalog/ /guitar/dir/catalog.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#wordpress
RewriteRule . /guitar/index.php [L]

 

The thing is:

I want

  mysite.com/catalog/category

to become

  mysite.com/catalog/category/

 

This shouldn't be much of an issue, right?

 

Thanks!

Link to comment
Share on other sites

Add the following:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://yoursite.com/$1/ [R=301,L]

at the top of your .htaccess after RewriteEngine On. Change yoursite.com to your website address.

 

This will check to see if the url ends in a / if it doesn't it'll add it in.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.