S
S
sergt20072014-07-21 18:21:14
htaccess
sergt2007, 2014-07-21 18:21:14

How to replace spaces in URL in htaccess?

On my site, the page URLs contained spaces. For CNC, at the request of SEO, spaces in the URL were replaced with dashes. There are more than 2000 such pages. Now I need to write a Redirect 301 for these pages. Writing a Redirect 301 on every page is not an option, and I didn't succeed with regular expressions. Help, please, who can.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2014-07-21
@DmitriyEntelis

From the simplest and most problem-free in further support - in php, see if there is a space in the url, if there is - do a redirect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question