title: Rewrite URL characters in Joomla with htaccess or router.php
body: <p>In order to avoid a URL problem in Joomla (components conflict) I must place a dash after a slash :D Example URL "...blog/-article-name" What I need now is to rewrite "/-" to "/" I've spend quite some time to find how to do it with a router.php but with no success. Now I ask for help. Can someone tell me how to do it with htaccess or router.php?<br>
  Thanks in advance.</p>
  
  <p>This is where I tried to insert the recommended rule in my htaccess:</p>
  
  <pre><code>#####################################################
  #  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
  #
  # The line just below this section: 'Options +FollowSymLinks' may cause problems
  # with some server configurations.  It is required for use of mod_rewrite, but may already
  # be set by your server administrator in a way that dissallows changing it in
  # your .htaccess file.  If using it causes your server to error out, comment it out (add # to
  # beginning of line), reload your site in your browser and test your sef url's.  If they work,
  # it has been set by your server administrator and you do not need it set here.
  #
  #####################################################
  
  ##  Can be commented out if causes errors, see notes above.
  Options +FollowSymLinks
  
  #
  #  mod_rewrite in use
  /********** TRYED HERE ********/
  RewriteCond %{HTTP_HOST} ^www\.mysite\.com [NC]
  RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
  /********** TRYED HERE ********/
  RewriteEngine On
  /********** TRYED HERE ********/
  
  ########## Begin - Rewrite rules to block out some common exploits
  ## If you experience problems on your site block out the operations listed below
  ## This attempts to block the most common type of exploit `attempts` to Joomla!
  #
  ## Deny access to extension xml files (uncomment out to activate)
  #&lt;Files ~ "\.xml$"&gt;
  #Order allow,deny
  #Deny from all
  #Satisfy all
  #&lt;/Files&gt;
  
  ## End of deny access to extension xml files
  RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
  # Block out any script trying to base64_encode crap to send via URL
  RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
  # Block out any script that includes a &lt;script&gt; tag in URL
  RewriteCond %{QUERY_STRING} (\&lt;|%3C).*script.*(\&gt;|%3E) [NC,OR]
  # Block out any script trying to set a PHP GLOBALS variable via URL
  RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  # Block out any script trying to modify a _REQUEST variable via URL
  RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  # Send all blocked request to homepage with 403 Forbidden error!
  RewriteRule ^(.*)$ index.php [F,L]
  #
  ########## End - Rewrite rules to block out some common exploits
  
  #  Uncomment following line if your webserver's URL
  #  is not directly related to physical file paths.
  #  Update Your Joomla! Directory (just / for root)
  
  RewriteBase /
  /********** TRYED HERE ********/
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
  RewriteRule ^index\.php$ http://www.mysite.com/ [R=301,L]
  RewriteRule ^index\.html$ http://mysite.com/ [R=301,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  /********** TRYED HERE ********/
  
  #Check to see if browser can accept gzip files.
  ReWriteCond %{HTTP:accept-encoding} (gzip.*)
  #make sure there’s no trailing .gz on the url
  ReWriteCond %{REQUEST_FILENAME} !^.+gz$
  #check to see if a .gz version of the file exists.
  RewriteCond %{REQUEST_FILENAME}gz -f
  #All conditions met so add .gz to URL filename (invisibly)
  RewriteRule ^(.+) $1gz [L]
  AddType “text/css;charset=UTF-8? .cssgz
  AddEncoding gzip .cssgz
  AddType “text/javascript;charset=UTF-8? .jsgz
  AddEncoding gzip .jsgz
  
  # Disable calls to user registration or password or username reset ("register", "remind", "reset")
  RewriteCond %{REQUEST_URI} /component/user/(remind|reset|register)(\.html)? [OR]
  RewriteCond %{QUERY_STRING} option=com_user&amp;view=(remind|reset|register)
  
  # Send all blocked request to homepage with 403 Forbidden error!
  RewriteRule index\.php$ http://new.marioiliev.com/ [R=301,L]
  
  ########## Begin - Joomla! core SEF Section
  #
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !^/index.php
  RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
  RewriteRule (.*) index.php
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
  #
  ########## End - Joomla! core SEF Section
  
  # Deny access to php, xml and ini files 
  # within components and plugins directories
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteCond %{REQUEST_URI} \.php|\.ini|\.xml [NC]
  RewriteCond %{REQUEST_URI} \/components\/ [OR]
  RewriteCond %{REQUEST_URI} ^\/includes\/|^\/administrator\/includes\/ [OR]
  RewriteCond %{REQUEST_URI} \/language\/ [OR]
  RewriteCond %{REQUEST_URI} \/libraries\/ [OR]
  RewriteCond %{REQUEST_URI} \/modules\/ [OR]
  RewriteCond %{REQUEST_URI} \/plugins\/ [OR]
  RewriteCond %{REQUEST_URI} \/templates\/ [OR]
  RewriteCond %{REQUEST_URI} \/xmlrpc\/
  RewriteRule ^(.*)$ index.php [R=404,L]
  
  # Prevent most common SQL-Injections
  RewriteCond %{query_string} concat.*\( [NC,OR]
  RewriteCond %{query_string} union.*select.*\( [NC,OR]
  RewriteCond %{query_string} union.*all.*select [NC]
  RewriteRule ^(.*)$ index.php [F,L]
  
  # Block most common hacking tools
  SetEnvIf user-agent "Indy Library" stayout=1
  SetEnvIf user-agent "libwww-perl" stayout=1
  SetEnvIf user-agent "Wget" stayout=1
  deny from env=stayout
  </code></pre>