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!

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.