0

I have done a 301 redirect for all trailing splash URLs in my htaccess file. Now I have a few dynamic URLs `website.com/item/activate/#dynamiclychangingvalue**/** that need the splash. Note that in the end on the activate folder is a dynamic url that needs the splash.

How would I edit the .htaccess file? I have tried all sorts of codes, they dont seem to be working.

   IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

the dynamic url looks like this website.com/item/activate/#dynamiclychangingvalue**/**

mark669
  • 21
  • 3

1 Answers1

1

You can use:

RewriteCond %{REQUEST_URI} !^/additem/ [NC] 
RewriteRule ^(.+)/$ $1 [R=301,L]
Croises
  • 18,570
  • 4
  • 30
  • 47
  • Seems like its not working, my dynamic urls look like this website.com/item/activate/#dynamiclychangingvalue/ I added my full htaccess file to this post. – mark669 Jan 31 '17 at 23:53
  • In this case, change `/additem/` to `/item/`. I can not know how to recognize your specific url ... I use the name in your question ! – Croises Feb 01 '17 at 07:42
  • Hello, Croises. This i understand. The issue is that the code you added does not add the splash to the end of the dynamic URL. The URl is as follows website.com/item/activate/#dynamiclychangingvalue**/** now I should somehow tell the system that the directory activate and the dynamic url that comes after should be allowed to contain a slash – mark669 Feb 01 '17 at 09:45