Title: Error After Setting Permalinks
Last modified: August 19, 2016

---

# Error After Setting Permalinks

 *  [snailbird](https://wordpress.org/support/users/snailbird/)
 * (@snailbird)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/error-after-setting-permalinks/)
 * Hey all, I recently decided to completely revamp my freelance site and that included
   changing the permalinks. Now I changed them fine for my blog site with no issues,
   but I when I attempted to do the same for my separate design domain, I got the
   following errors showing up at the top of every page:
 * Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat
   at offset 1 in /home/snailbir/public_html/designcoyote.com/wp-includes/classes.
   php on line 210
 * Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat
   at offset 1 in /home/snailbir/public_html/designcoyote.com/wp-includes/classes.
   php on line 211
 * On some pages, it’s just these two, but on other pages, the error messages duplicate
   twice. Once I change the permalinks structure back to the default, the messages
   go away. I have no clue what I did wrong, and I’m pretty sure I didn’t touch 
   the classes.php files and that it’s the same for both my blog and the design 
   site.
 * Anyone have any solutions or did I forget a step that I’m going to kick myself
   for later? Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [greatfrenchsongs](https://wordpress.org/support/users/greatfrenchsongs/)
 * (@greatfrenchsongs)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/error-after-setting-permalinks/#post-1162801)
 * Hi,
 * I got the same problem on my Windows development machine after downloading the
   code from my linux server. Also after enabling permalinks (although this could
   be a coincidence).
 * The problem is caused when values in the $match variable around the lines 210
   and 211 in classes.php begin with a question mark. As the ? is not escaped, the
   preg_match function expects the ? to relate to the previous character, which 
   doesn’t exist.
 * I’ve not analysed it too much because it’s just my development machine that goes
   wrong, but I solved it in dev by adding this line of code above the foreach statement
   on line 210
 * $match = str_replace(‘?’, ‘\?’, $match);
 * I believe this is what the $match variable should hold in anycase – escaped question
   marks where they are part of the URL being searched for. For example one of the
   $match values is
 * ?p=[0-9]+&name=[^/]+/attachment/([^/]+)/?$
 * And that question mark at the beginning is causing the problem.
 *  [nanfch](https://wordpress.org/support/users/nanfch/)
 * (@nanfch)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/error-after-setting-permalinks/#post-1162818)
 * $match = str_replace(‘?p=’, ‘\?p=’, $match);

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error After Setting Permalinks’ is closed to new replies.

## Tags

 * [classes.php](https://wordpress.org/support/topic-tag/classes-php/)
 * [error message](https://wordpress.org/support/topic-tag/error-message/)
 * [permalinks](https://wordpress.org/support/topic-tag/permalinks/)
 * [WordPress 2.8](https://wordpress.org/support/topic-tag/wordpress-2-8/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 3 participants
 * Last reply from: [nanfch](https://wordpress.org/support/users/nanfch/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/error-after-setting-permalinks/#post-1162818)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
